Hi Steven, Allthough I haven't actually tried it, the Base64Encoder class should work with Flash CS3 as well. AFAIK there's nothing Flex specific in that class, apart from the MetaData tag (ExcludeClass) at the top (which Flash will probably just ignore).
You should also be able to send the binary data in an xml packet. regards, Muzak ----- Original Message ----- From: "Paul Steven" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Wednesday, July 04, 2007 11:21 AM Subject: RE: [Flashcoders] Desktop app that uploads files to serverusingbinarydata > Thanks Muzak > > Yes you are certainly right that I hadn't a clue what to search for. > > Your reply is extremely helpful and I feel I can make a start on this. I > hadn't considered Flex for this project but this is now a serious > consideration and I am downloading a copy now. Great I will have to learn > not only AS3 but also Flex!! > > Out of interest, is there a Base64Encoder for Flash CS3 or is this just > available for Flex? > > Another question, once I have read in the file and converted to a binary > string, can I send this data as xml data? I think the API provided by the > client expects all data to be sent via xml. Hope this makes sense, as > currently I am still a little unsure of things - I normally just develop > games so this project involves a lot of new territory:) > > > Thanks > > Paul > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Muzak > Sent: 04 July 2007 02:51 > To: [email protected] > Subject: Re: [Flashcoders] Desktop app that uploads files to server > usingbinarydata > > The reason why're you're not finding much info is probably because you more > or less have to know what to look for ;-) > > Try looking for Base64Encoder > http://tools.assembla.com/flexsdk/browser/mx/utils/Base64Encoder.as > > mx.utils.Base64Encoder class is an undocumented Flex 2 AS3 class, which will > be documented in Flex 3. > > an example sending an image to server: > http://djangonflex.wordpress.com/2007/06/30/sending-images-from-flex-to-a-se > rver/ > > These might come in handy as well: > - JPEGEncoder > - PNGEncoder > They're available in the as3corelib: > http://code.google.com/p/as3corelib/ > http://as3corelib.googlecode.com/svn/trunk/src/com/adobe/images/ > > So basically what you'll need to do when a file is dropped on your app is > load that file as raw Binary data > > fileLoader = new URLLoader(); > fileLoader.dataFormat = URLLoaderDataFormat.BINARY; > > Once the file is loaded, convert it to a binary string (using Base64Encoder) > and then send it to your server script using > HTTPService (not sure what the Flash CS3 equivalent is). > > By the way, you can use Flex with Zinc. > > regards, > Muzak > > ----- Original Message ----- > From: "Paul Steven" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Tuesday, July 03, 2007 3:24 PM > Subject: [Flashcoders] Desktop app that uploads files to server using > binarydata > > >>I am building a desktop app (mac and pc) and it has to upload a bunch of >> files - pdf's, word docs and images - to a server side script. This has to >> be done via HTTP and cannot be FTP. >> >> The problem arises because I do not want the user to have to select the >> file/s before uploading so I cannot use the flash 8 FileReference class. >> >> The user should be able to drag the required files onto the application. >> >> I believe it is possible to upload binary data using AS3 but I cannot find >> any examples of this and as I have not as yet looked at AS3, some examples >> or advice on where to start would be much appreciated. >> >> As far as I am aware I will need to use Zinc to package the application as >> this will provide additional functionality such as the ability to drag and >> drop files onto the application. >> >> Apollo / Air is out of the question as it is only in beta stage and also >> this application needs to be run from a flash drive without any preinstall >> on the users hard drive. >> >> Thanks in advance >> >> Paul _______________________________________________ [email protected] To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com

