elimak

Uploading large files with Flash: split the ByteArray

I recently came across a project that required the upload of large files on a remote server.
Because the binary file was generated directly within the application, I could not use FileReference and its upload() method.
Unfortunately, while using the URLLoader, one cannot monitor the ProgressEvent as it wont be fired.

The easiest way to solve this issue is to split the binary file and to upload it in pieces.
You will not be able to monitor the progress, but you can update a progress bar when the upload of each chunk is completed.
It will also solve problems related to the max_file_size upload.

I could not find any resource online, so I decided to share mine.
You can download a zip with the source files (php + as) here.

2 Comments

    Very good, but the merge of the files don’t work with binary files, images, pdf, zip files… You tested this code and worked for you? (sorry my bad english)

  • Hi,
    The code worked for me for binary files.
    I used it mainly with Avi and Mp3 files.

Leave a Reply

You must be logged in to post a comment.