AS3 ByteArray Uploader

Last post 05-09-2008 8:53 AM by BarryR. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-08-2008 3:39 PM

    AS3 ByteArray Uploader

    I'm creating an app that creates large amounts of binary data in memory and then uploads it to nirvanix as a file.
    I thought I would share this utility in case others might need to do the same.

    The link below includes a class to upload a bytearray of any size to nirvanix and works in Flash, Flex, and AIR on or offline.
    It uploads the data in chunks across multiple requests using the  content-range feature.
    It requires that you get the storage node and upload token on your own first, but provides a
    quick wrapper class to hold the host, uploadToken, destFolderPath, and fileName

    Example Usage:

    var data:ByteArray = createYourMassiveByteArray();

    var storageNode:NirvanixStorageNode = new NirvanixStorageNode();
    storageNode.host = "...";
    storageNode.uploadToken = "...";
    storageNode.destFolderPath = "...";
    storageNode.fileName = "...";

    var uploader:NirvanixBinaryUploader = new NirvanixBinaryUploader(storageNode, data);
    uploader.addEventListener(Event.COMPLETE, onComplete);
    uploader.addEventListener(ProgressEvent.PROGRESS, onProgress);
    uploader.upload();

    http://www.digimix.com/nirvanix/NirvanixAS3BinaryUploader.zip 

  • 05-09-2008 8:53 AM In reply to

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 466

    Re: AS3 ByteArray Uploader

     Thank you for this great contribution.  If you don't mind, I would like to add this to our files area as a user contribution as well as a link to your site.

    Best Regards,
        Barry R.

Page 1 of 1 (2 items)