Sorry... I can't deal with all the SPAM so until I can find a better solution for the forums, I'm locking them down. For now please use awesome services like stackoverflow.com for community support. Thanks.
This forum is a community forum meant for users of the plugin to collaborate and help solve issues with implementation, etc. Unfortunately, as the creator of the plugin, I do not have much time to attend to every request here as this is only a side project and I must work a full-time job to provide for my family. This is how I keep the Flash version free and the HTML5 version low cost.
Uploading to Amazon S3
  • Does anyone know if Uploadify can post files to S3 correctly?
  • I am in the midst of trying to get Uploadify to work with Amazon S3 in a ColdFusion environment. At this stage, I've gotten SWFUpload to work, but I prefer Uploadify because it would be much cleaner to implement in a multi-instance format. I have hit a few issues with Uploadify and would appreciate some guidance with the debugging.

    This is how my script looks roughly:

    jQuery(".Uploader").uploadify({
    //'uploader' : 'http://bucketname s3.amazonaws.com/uploadify.swf',
    'uploader' : 'controls/uploadify/uploadify.swf',
    'script' : 'http://bucketname.s3.amazonaws.com/',

    'cancelImg' : 'controls/uploadify/cancel.png',
    'fileDataName' : 'file',
    'method' : 'post',

    //'onError' : function(errorObj) { UploadifyError2(errorObj); },
    'onError' : function(errorObj) { window.ObjErrorStuff = errorObj; },

    'multi' : 'false',
    'auto' : 'true',
    'buttonText': 'Upload'
    });
    });

    1. I have not begun populating the scriptData parameter yet. When I post no parameters using SWFUpload, I still get an XML error package back.
    2. No HTTP POST call actually gets made to Amazon S3. I have checked this with WireShark.
    3. The SWF upload object doesn't like it when I load it from my bucket. When I load it locally (from /controls/uploadify/uploadify.swf), the button appears.
    4. I have a crossdomain.xml sitting in my bucket with public accessible permissions. I have also verified that uploadify.swf has public available permissions.
    5. Using onError, I set the error object to window.ObjErrorStuff. In a Firebug console, I set temp=window.ObjErrorStuff and then request temp.info. It returns nothing.
    6. With the Flash debugger enabled, I get this error half the time:
    ReferenceError: Error #1069: Property name not found on String and there is no default value.
    at uploadify_fla::MainTimeline/inQueue()
    at uploadify_fla::MainTimeline/fileSelectMultiHandler()

    Can anyone suggest a better way of debugging and at least getting an error from Amazon? At this stage, I'd be happy getting the XML result back from Amazon using WireShark, but at this stage, Uploadify doesn't seem to be even communicating with the 'script' target.

    Thanks.
  • hmmm, I've been trying to do this too. It looks to me like Uploadify is sending extra parameters in the POST which Amazon doesn't like. I posted to a dummy URL, wrote my POST to a log and compared it with the actual sample POST form you get from Amazon. Sure enough if I add the extra fields then the POST fails, these were the extra fields ...

    POST ... Array
    (
    [Filename] => example.mov
    [folder] => /video/manage/
    [fileext] => *.mov;
    [Upload] => Submit Query
    )


    Is there any way to stop Uploadify from sending these with the POST?
  • argh nevermind - i worked out you can put your extra fields in your policy, but I still get a 403 error
  • I've made some progress on being able to upload to S3. In fact, I can successfully upload, although not quite in the manner I want to. Here's how it is working for me:

    <html>
    <head>
    <script type=\"text/javascript\" src=\"jquery-1.3.2.min.js\"></script>
    <script type=\"text/javascript\" src=\"swfobject.js\"></script>
    <script type=\"text/javascript\" src=\"jquery.uploadify.v2.1.0.js\"></script>
    <link rel=\"stylesheet\" href=\"uploadify.css\" type=\"text/css\" media=\"screen\" />
    </head>

    <body>
    <form>
    <input id=\"fileInput\" name=\"fileInput\" type=\"file\" />
    </form>
    <script type=\"text/javascript\">// <![CDATA[
    $(document).ready(function() {
    $('#fileInput').uploadify({
    'fileDataName' : 'file',
    'uploader' : 'uploadify.swf',
    'script' : 'http://UPLOADBUCKET/',
    'cancelImg' : 'cancel.png',
    'auto' : true,
    'onError' : function(errorObj, q, f, err) { console.log(err); },

    'scriptData' : {
    AWSAccessKeyId: \"ACCESS_KEY\",
    key: \"foo/${filename}\",
    acl: \"public-read\",
    policy: \"POLICY STRING\"
    signature: \"SIGNATURE,
    success_action_status: '200'
    }

    });
    });
    // ]]></script>
    </body>

    </html>



    The base for the policy string is as follows:

    { \"expiration\": \"2100-12-01T12:00:00.000Z\",
    \"conditions\": [
    {\"acl\": \"public-read\" },
    {\"bucket\": \"UPLOADBUCKET\" },
    {\"success_action_status\" : '200'},
    [\"starts-with\", \"$filename\", \"\" ],
    [\"starts-with\", \"$folder\", \"\" ],
    [\"starts-with\", \"$key\", \"foo\"],
    [\"content-length-range\", 1, 209715200]
    ]
    }



    This code actually works. The upload succeeds and both S3 and Uploadify seem to be happy. I had been hoping to use a 201 response to maybe get some data back about the upload, but that doesn't seem to be working. Anyway, assuming I haven't borked the process of formatting the code here, this should do the trick for anyone hoping to upload to S3.
  • Actually, it looks like the code works, but the onComplete event is never fired. Oh well.
  • The onComplete notification does not fire due to a bug in Flash's handling of the 200 status code. See this page for more details: http://docs.amazonwebservices.com/Amazo ... Flash.html

    Unfortunately, Uploadify treats the suggested 201 response as a failure. I'll start a new topic for a bug handling 2xx response codes. For now, you can handle onError with code 201 as onComplete.
  • Any news on this?
    I've been able to make it work by including 'folder', 'fileext' and 'Filename' in the policy but now the problem is that sometimes the upload works, sometimes it returns SignatureDoesNotMatch.
    And if I refresh the page it works (or not). The expiration date is +1 hour so that shouldn't be a problem....
    Any ideas?
  • Ha, nailed it!
    There are several issues to overcome when using uploadify with s3:
    1. as mentioned above uploadify sends 3 more params to the server so you need to add them in your policy
    2. flashvars are urldecoded (once by javascript and once, I think, by flash). So you need to encodeURIComponent(encodeURIComponent()) for the parameters passed to scriptData. Especially the policy and signature. Otherwise you will get the "signature not matched" error from amazon.
    3. on windows (flash 10) the 201 code is captured by the onComplete function. You receive the xml string passed by amazon in the 4th param (response). On mac though the 201 code is captured by the onError. You need to test for errorObj.type == 201 and treat that as an onComplete. Unfortunately you don't get the response in any param in onError so if you need to know the filename of the upload you will have to read it from fileObj.name.

    I really recommend Wireshark for debugging the http traffic. It's been very helpful.
  • What are you guys using in the backend to generate the S3 signature? Also, does the policy string need to be Base64 encoded?
  • terebentina said:
    Ha, nailed it!
    There are several issues to overcome when using uploadify with s3:
    1. as mentioned above uploadify sends 3 more params to the server so you need to add them in your policy
    2. flashvars are urldecoded (once by javascript and once, I think, by flash). So you need to encodeURIComponent(encodeURIComponent()) for the parameters passed to scriptData. Especially the policy and signature. Otherwise you will get the "signature not matched" error from amazon.
    3. on windows (flash 10) the 201 code is captured by the onComplete function. You receive the xml string passed by amazon in the 4th param (response). On mac though the 201 code is captured by the onError. You need to test for errorObj.type == 201 and treat that as an onComplete. Unfortunately you don't get the response in any param in onError so if you need to know the filename of the upload you will have to read it from fileObj.name.

    I really recommend Wireshark for debugging the http traffic. It's been very helpful.


    Greetings and Hello!

    Could you show us how you did it via an example, please? I'm looking forward on your kind reply. Thanks and God bless!



    .ubunTux
  • I'm also having some trouble with this. Here's my javascript code:

    <script type='text/javascript'>
    $(function() {
    $('#upload-files').uploadify({
    'fileDataName': 'file',
    'uploader': 'uploadify.swf',
    'script': 'BUCKET',
    'method': 'post',
    'auto': true,
    'scriptAccess':'always',
    'onError': function(e, q, f, err) { window.console.log(err); },
    'scriptData': {
    AWSAccessKeyId: 'AKIAJERVIXBJLFLRMBQA',
    key: '${filename}',
    acl: 'public-read',
    policy: 'policy',
    signature: 'signature',
    }
    })
    });

    ..And here's my policy:

    policy_document = {
    'expiration': '2015-01-01T00:00:00Z',
    'conditions': [
    {'bucket': settings.AWS_BUCKET_NAME},
    [\"content-length-range\", 1, 209715200],
    {'acl': 'public-read'},
    {'success_action_status': 201},
    [\"starts-with\", \"$Filename\", \"\" ],
    [\"starts-with\", \"$folder\", \"\"],
    {\"key\":\"${filename}\"},
    [\"starts-with\", \"$Content-Type\", \"image/\"],
    {\"Upload\": \"Submit Query\"},
    ]
    }

    By setting up a dummy URL to tell me what's inside request.POST, I can see that this is what's getting sent by Uploadify:

    {'AWSAccessKeyId':['ACCESSKEY'],
    'Upload': ['Submit Query'],
    'acl': ['public-read'],
    'key': ['${filename}'],
    'signature': ['SIGNATURE'],
    'policy': ['POLICY='],
    'folder': ['/foo/'],
    'Filename': ['IMG_0200.JPG']}

    As far as I can tell, I have entries in my policy file for each of these parameters - but whenever I try to upload to S3, I only ever got the '403 forbidden' error. Can anyone tell me what I've missed?
  • Ok, here is my js code:

    $(\"#upload_btn\").uploadify({
    'uploader' : 'static/flash/uploadify.swf',
    'script' : 'http://bucket.s3.amazonaws.com/',
    'scriptData' : {
    \"AWSAccessKeyId\": encodeURIComponent(encodeURIComponent(\"your aws key\")),
    \"key\": encodeURIComponent(encodeURIComponent(\"40/20091216-120535/${filename}\")),
    \"acl\": \"private\",
    \"policy\": encodeURIComponent(encodeURIComponent(\"your policy string\")),
    \"signature\": encodeURIComponent(encodeURIComponent(\"signature string\")),
    \"success_action_status\": \"201\",
    \"folder\": encodeURIComponent(encodeURIComponent(\"\")),
    \"fileext\": encodeURIComponent(encodeURIComponent(\"\")),
    \"Filename\": encodeURIComponent(encodeURIComponent(\"\"))
    },
    'fileDataName' : 'file',
    'scriptAccess' : 'always',
    'fileExt' : '*.jpg;*.jpeg;*.png;*.gif',
    'fileDesc' : 'Images',
    'onError' : function(a, b, c, d) {
    if (d.info == 201) {
    var $queue = $('#queue').html('Processing, please wait...').show();
    $.post(
    'user/s3flphoto/f2507de7ea81f68b3eddcdfd876fd144',
    {'fn': c.name},
    function(data) {
    $queue.hide();
    }
    );
    } else {
    page_message('Ughh, something wrong happened. Can you please try again?', 1);
    }
    },
    'onComplete' : function(a, b, c, d, e) {
    var $queue = $('#queue').html('Processing, please wait...').show();
    $.post(
    'user/s3flphoto/f2507de7ea81f68b3eddcdfd876fd144',
    {'xml': d},
    function(data) {
    $queue.hide();
    }
    );
    },
    'folder' : '',
    'queueID' : 'queue',
    'buttonText' : 'Browse',
    'auto' : true,
    'method' : 'post',
    'multi' : false
    });


    In the policy I included 'folder', 'fileext', 'Filename'

    Use Wireshark to see what that 403 forbidden actually means. Amazon always sends you an xml response back, even with a 403 code, with more details about the error. 403 can mean invalid signature but can also mean parameter 'fileext' not found in policy (just an example).
  • Thanks terebentina!

    Got a follow-up question though...

    Is it possible I could change the filename before the upload process takes place? How?

    Also, I would like to pass Content-Type since it's required in the policy. To be able to pass the correct Content-Type (or MIME type), I'd like to call a custom JS function that will return the MIME type of the file being uploaded.



    .ubunTux
  • @terebentina,

    May we also ask you to show us your policy?



    .ubunTux
  • My policy is:
    {
    "expiration":"2009-12-20T14:40:38Z",
    "conditions":[
    {"bucket":"mybucket"},
    {"acl":"private"},
    {"success_action_status":"201"},
    ["starts-with","$key","40\/20091220-144038\/"],
    ["starts-with","$folder",""],
    ["starts-with","$fileext",""],
    ["starts-with","$Filename",""],
    ["content-length-range",0,5242880]
    ]
    }

    I am using this S3 library to generate the params for uploadify like this:
    $post_params = Fileop::instance('s3')->getHttpUploadPostParams('bucket', $key, 'private', 3600, 5242880, 201, array(), array('folder'=>'', 'fileext'=>'', 'Filename'=>''));

    And then in the html, to output the code js code from my post above:

    .....................
    'scriptData' : {
    <?php
    $output = '';
    foreach ($post_params as $p => $v) {
    $output .= '\"'.$p.'\": encodeURIComponent(encodeURIComponent(\"'.$v.'\")),'.\"\n\";
    }
    echo substr($output, 0, -2);
    ?>
    },
    'fileDataName' : 'file',
    ....................


    The getHttpUploadPostParams() function from that library also has support for headers (that empty array() param I am using) so this should give you the correct $post_params to use, even if you want to add headers.
  • Woot! My uploader works fantastically now! Thanks again terebentina!



    .ubunTux
  • Hey Guys,

    Is there anyway you guys can share how you generate your signatures? I'm able to create do the HMAC-SHA1 Base64 digest, I'm just not clear what I would use as the content. The S3 documentation states:


    Signature = Base64( HMAC-SHA1( UTF-8-Encoding-Of( YourSecretAccessKeyID, StringToSign ) ) );

    StringToSign = HTTP-Verb + \"\n\" +
    Content-MD5 + \"\n\" +
    Content-Type + \"\n\" +
    Date + \"\n\" +
    CanonicalizedAmzHeaders +
    CanonicalizedResource;


    What do you guys use as StringToSign?

    Thanks.
  • I got it.. It's the policy string that needs to be HMAC-SHA1 encrypted and Base64 encoded. Thanks everyone for posting your configs.
  • Hi!
    This thread helped me a lot in getting uploadify to work with, so i thought I'd post what did it for me.
    Im using the this php class: http://undesigned.org.za/2007/10/22/amazon-s3-php-class to generate the policy and the signature, and json to pass it to javascript:
    The php script:

    <?php
    require_once 'S3.php';
    $s3 = new S3(ACCESS_KEY, SECRET_KEY);
    $key = $_GET['key'];
    $json = array();
    $json = $s3->getHttpUploadPostParams(BUCKET, $key, 'private', 3600, 5242880, 201, array(), array('folder'=>'', 'Filename'=>''));
    $encoded = json_encode($json);
    die($encoded);
    ?>


    and the javascript to get the stuff:

    $.get('getS3Info.php', {'key': 'some/path/here/'},
    function(data){
    var scriptData = {
    'AWSAccessKeyId': data.AWSAccessKeyId,
    'key': data.key,
    'acl': \"private\",
    'policy': data.policy,
    'signature': data.signature,
    'success_action_status': \"201\",
    'folder':'',
    'Filename':''
    };
    $('#upload_link').uploadifySettings('scriptData',scriptData);
    },
    \"json\" );


    I couldn't get it to work when using the encodeURIComponent(encodeURIComponent()) trick terebentina suggested, and it didn't work when inculing 'fileext' in the policy. In both cases I got a "Signature doesn't match" error from Amazon (thanks for the Wireshark idear, it really helped me getting this stuff to work).

    This is how i "declare" uploadify (I've removed for formatting stuff like img's and dimentions):

    $('#upload_link').uploadify({
    'uploader': 'uploadify.swf',
    'script': 'http://BUCKET.s3.amazonaws.com',
    'multi': 'true',
    'auto':'true',
    'method':'post',
    'scriptAccess':'always',
    'onError':function(e, queueID, fileObj, errorObj){
    if(errorObj.info == 201){
    $('#upload_link'+queueID).remove();
    } else {
    alert(errorObj.type+' error:'+errorObj.info+'. Sorry! (try again later)');
    }
    },
    'folder':'',
    'fileDataName':'file'
    });



    I've made a thread in the showcase subject where I've put it all together: viewtopic.php?f=5&t=4713
  • Hi all, I was battling with similar problems getting fancyupload to work for uploading directly to s3.
    But I got most of them sorted so far and my uploader works rather well. Check it out on http://www.railstoolkit.com/posts/uploa ... ancyupload in case you are interested.

    Nico
  • Here are some helpful tips from my experience of implementing this.
    I've been able to make it work by including 'folder', 'fileext' and 'Filename' in the policy

    With mine, Amazon responded back in its XML saying it didn't like 'fileext'. Probably because I'm not specifying any extension filters. So I took it out and it worked.
    ...but now the problem is that sometimes the upload works, sometimes it returns SignatureDoesNotMatch.

    I recommend using this S3 library http://undesigned.org.za/2007/10/22/amazon-s3-php-class (as seen above). Then after you use this to get your signature, you do need to encode it using encodeURIComponent(). Here is a nice tool I found for verifying that your signature is correct. [attachment=0]s3-sigtester.zip[/attachment] With this tool you'll need to know the response back from Amazon, so to get their response you need to use uploadify's "onComplete" event and then view the contents of the fourth parameter 'response'. This doesn't show all of the respsonses though, so you may need to use a packet sniffer like "Wireshark" to look at the XML response from Amazon.

    Also, make sure your expiration time is set for like a day, instead of 1 hour. I've had better success with this. So below change 3600 to (60*60*24 * 1) where 1 at the end represents how many days (keep the parenthesis).
    $post_params = Fileop::instance('s3')->getHttpUploadPostParams('bucket', $key, 'private', 3600, 5242880, 201, array(), array('folder'=>'', 'fileext'=>'', 'Filename'=>''));

    To this...
    $post_params = Fileop::instance('s3')->getHttpUploadPostParams('bucket', $key, 'private', (60*60*24 * 1), 5242880, 201, array(), array('folder'=>'', 'fileext'=>'', 'Filename'=>''));

    Also, note that 5242880 is the maximum file size. So if you get an error about file size, try upping this to something like (1024 * 1024 * 2000).

    I hope this helps!
  • I kept getting the "Signature Mismatch" error and I decided to dig into the flash source and find out what was going on.

    The problem is that when Actionscript 3 is encoding URLs, it will encode a + to a space instead of to %2B. I found that PHP's function returns %2B and Actionscript returns a space. So rather than try to figure out how to get Actionscript 3 to encode correctly, I made a recursive function to get a signature without a + sign. Here is my function below for anyone who would like it.
    	public function gets3info()
    {
    header('Content-type: application/json');

    $s3 = new S3('your-access-key', 'your-secret-key');

    $key = $_GET['key'];
    $bucket = \"yourbucket\";
    $json = $s3->getHttpUploadPostParams($bucket, $key, 'private', (60*60*24 * 1), (1024 * 1024 * 2000), 201, array(), array('folder'=>'', 'Filename'=>''));

    # Make sure we don't have a signature with a '+' because Actionscript 3 encodes them as spaces instead of %2B
    if (strpos($json->signature, '+') !== FALSE)
    {
    $this->gets3info();
    }
    else
    {
    $json->bucket = $bucket;

    $encoded = json_encode($json);

    die($encoded);
    }
    }
  • Would anyone be available to do this setup at a set price? I would like to setup Amazon S3 with Uploadify, and possibly with Gravity Forms if that is possible?

    please email me at george (at) thatmlmbeat dot com.

    New in this forum so apologies if this is not the place to be asking. :)
  • I confirm the decode function behavior trying to decode + (plus) sign to a %20 instead of %2B.
    I can't find the source repository so I post here my code.

    At line 342 of actionscript code change
    if (param.scriptData != '') variables.decode(unescape(param.scriptData));

    to
    if (param.scriptData != '') variables.decode(unescape(param.scriptData).replace('+', '%2B'));


    Hope you'll use a kind of source repository (github or google code) for this cool project.
  • Anyone interested in integrating Uploadify into their Django project in order to do direct (browser-based) uploads to Amazon S3 should take a look at my the django-uploadify-s3 application I recently posted to github.

    https://github.com/sbc/django-uploadify-s3
  • Hi,

    I cannot get this S3 integration to work, it just doesn't load the flash. All my paths are correct but no load? Just a standard input button.

    What am I doing wrong?

    Cheers.
  • Hi Could someone Please take a look at my code and tell me where i am going wrong. here is what i get outputted from my policy.

    "AWSAccessKeyId": encodeURIComponent(encodeURIComponent("Amazon Key")), "key": encodeURIComponent(encodeURIComponent("${filename}")), "acl": encodeURIComponent(encodeURIComponent("private")), "policy": encodeURIComponent(encodeURIComponent("eyJleHBpcmF0aW9uIjoiMjAxMS0wMS0yOFQwMjowMTowNVoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpc2RtdXNpYyJ9LHsiYWNsIjoicHJpdmF0ZSJ9LHsic3VjY2Vzc19hY3Rpb25fc3RhdHVzIjoiMjAxIn0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCIiXSxbInN0YXJ0cy13aXRoIiwiJGZvbGRlciIsIiJdLFsic3RhcnRzLXdpdGgiLCIkRmlsZW5hbWUiLCIiXSxbImNvbnRlbnQtbGVuZ3RoLXJhbmdlIiwwLDUyNDI4ODAwXV19")), "signature": encodeURIComponent(encodeURIComponent("/SY2fMBopByN90qU27EUFClT52c=")), "success_action_status": encodeURIComponent(encodeURIComponent("201")), "folder": encodeURIComponent(encodeURIComponent("")), "Filename": encodeURIComponent(encodeURIComponent(""))

    So i am taking this information as show above and inserting it as follows.

    <html>
    <head>
    <script type="text/javascript" src="up/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="up/swfobject.js"></script>
    <script type="text/javascript" src="up/jquery.uploadify.v2.1.4.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $('#uploadify_div').uploadify({
    'uploader': 'up/uploadify.swf',
    'script' : '<a href="http://bucket.s3.amazonaws.com&quot; target="_blank" rel="nofollow">http://bucket.s3.amazonaws.com</a>',
    'scriptData' : {
    <?php
    $output = '';
    foreach ($post_params as $p => $v) {
    $output .= '"'.$p.'": encodeURIComponent(encodeURIComponent("'.$v.'")),'."\n";
    }
    echo substr($output, 0, -2);
    ?>
    },
    'fileDataName' : 'file',
    'scriptAccess' : 'always',
    'onError' : function(a, b, c, d) {
    if (d.info == 201) {
    var $queue = $('#queue').html('Processing, please wait...').show();
    $.post(
    'user/s3flphoto/f2507de7ea81f68b3eddcdfd876fd144',
    {'fn': c.name},
    function(data) {
    $queue.hide();
    }
    );
    } else {
    page_message('Ughh, something wrong happened. Can you please try again?', 1);
    }
    },
    'onComplete' : function(a, b, c, d, e) {
    var $queue = $('#queue').html('Processing, please wait...').show();
    $.post(
    'user/s3flphoto/f2507de7ea81f68b3eddcdfd876fd144',
    {'xml': d},
    function(data) {
    $queue.hide();
    }
    );
    },
    'folder' : '',
    'auto' : true,
    'multi' : false
    });

    });
    </script>
    </head>
    <body>
    <div id="uploadify_div"></div>
    </body>
    </html>



    I am soooooooooooooooooooooooooooooo stuck please help.

    encodeURIComponent(encodeURIComponent("")), "Filename": encodeURIComponent(encodeURIComponent(""))
  • The user and all related content has been deleted.
  • Try Bucket Explorer to upload files in different-2 way like
    simple upload , upload as html, upload with custom header, upload with rrs, upload in batch, upload only changed data, upload with comparing name and size only etc.
  • The user and all related content has been deleted.
  • The user and all related content has been deleted.
  • Here is my uploadify code what am i using on the rails + Amazon S3 env...

    $(document).ready(function() {

    $('#custom_file_upload').click(function(event){
    event.preventDefault();
    });
    $('#custom_file_upload').uploadify({
    buttonText: 'Select filess',
    scriptAccess: 'always',
    fileExt: '*.jpg;*.jpeg;*.png;*.gif',
    fileDesc: 'Images',
    auto: true,
    method: 'post',
    multi: true,
    uploader: '/javascripts/uploadify/uploadify.swf',
    cancelImg: '/javascripts/uploadify/cancel.png',
    script : "<a href='https://bucket.s3.amazonaws.com' target='_blank' rel='nofollow'>https://bucket.s3.amazonaws.com</a>",
    scriptData: {
    'AWSAccessKeyId': 'awsaccesskey',
    'key': 'myserectkey',
    'acl': 'private',
    'policy': 'mypolicy',
    'signature': 'ma76ECHhpy1GAeIdTZrcCr8YFvg=',
    'success_action_status': '201',
    'folder': 'user_files/prince/11-11-2011_14:45:16/${filename}',
    'Filename': '11-11-2011_14:45:16'
    },
    onComplete: function(a, b, c, d, e) {
    var $queue = $('#queue').html('Processing, please wait...').show();
    $.post( 'user/s3flphoto/f2507de7ea81f68b3eddcdfd876fd144',
    {'xml': d},
    function(data) {
    $queue.hide();
    }
    );
    }
    });

    $('#upload_submit').click(function(event){
    event.preventDefault();
    $('#upload_photo').uploadifyUpload();
    });

    });
    </script>
    <h3>
    <div class='text'>Upload file</div>
    <div class='clear'></div>
    </h3>
    <div class='uploadForm'>
    <div id="status-message">Select some files to upload:</div>
    <input id="custom_file_upload" type="file" name="Filedata" />
    </div>

    Actually, whenever i add a new file for uploading. Always it struck at middle of process sometimes 8% and sometimes 31% .. And there is nothing come into the bucket folder structure as well..

    Please help me out for fixing this bug...


    Many thanks in advance
  • http://stackoverflow.com/questions/10463360/uploadify-3-1-trying-to-upload-to-amazon-s3-signaturedoesnotmatch

    The above stackoverflow explains the issues I have. If anyone with experience with this problem can you be so kind to help. It would appear that this thread may be able to enlighten me.
  • Hi Guys,

    I've got the uploadify + S3 solution working now, but have one question. Has anyone already managed to pass the correct content-type to s3? I can set it manually in the ScriptData property, but does anyone know how to auto detect this?

    Thanks!