tags:

views:

510

answers:

2

I am doing file transfers, but the filereference API doesn't support file chunking. Has anyone done this before? For example, I would like to be able to upload a 1 gig file from an AIR client to a custom PHP/Java/etc. service.

+1  A: 

It seems that all you should have to do is use the upload() routine. The php or java service should be doing the chunking.

var myHugeFile = new air.File('myHugeLocal.file');
myHugeFile.upload(new URLRequest("http://your.website.com/uploadchunker.php"));

There is a much more elaborate example of using filereference in the adobe learning area here: http://www.adobe.com/devnet/air/flex/articles/uploading_air_app_to_server.html

AndrewB
A: 

Three options jump out on this:

  1. Use an FTP service that supports resumable transfers, assuming flash supports this as well. Maybe not an option if you are wanting to communicate with a custom service of your own.
  2. Leverage the http file part header support. Only applicable if AIR allows access to the appropriate http headers (content-range & content-length). This is what BITS does. Probably a bit harder to implement.
  3. Hand roll your own TCP or UDP protocol exchange. Not for the faint of heart. I'd look in the OSS space before going this route.
JasonCoder