Paul,

In order to send the files to the server you must use a POST HTTP request. Therefore the bitmap data has to be encoded in Base 64. Muzak posted a link to upload images to the server below. :)

- Nick

Paul Steven wrote:
Do I need to convert the data to Base64? I am curious as to why I cannot
just send the binary data as it is?

Thanks

Paul


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: <flashcoders@chattyfig.figleaf.com>
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




_______________________________________________
Flashcoders@chattyfig.figleaf.com
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

_______________________________________________
Flashcoders@chattyfig.figleaf.com
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


_______________________________________________
Flashcoders@chattyfig.figleaf.com
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

Reply via email to