1

i am using the SWFUpload object to upload files to the Amazon S3 Bucket which uses the synchronous way to upload files when Javascript enabled in browser now i want to save them in a specific way (want to add a specific header) which i am going to pass from the view and then use that in the file name for Amazon S3 bucket but as here we are using the asynchronous way so not possible to pass any parameter from View

    <input class="t-button" type="file" id="photo" name="photo" />

    $("#photo").makeAsyncUploader({
                upload_url: "URL for the function to be called from controller",
                flash_url:<value>,
                button_image_url : <Value>

etc etc, i tried but as i am not that much good in Javascript couldn't make it. Any type of example or help will be appriciated.

Thanks and Regards

Ram Sharma
  • 51
  • 1
  • 6

1 Answers1

1

Add a query string, for example:

 upload_url: "URL for the function to be called from controller" + "?header=yourHeader"

and add a parameter (string header) to your controller method.

free4ride
  • 1,613
  • 1
  • 18
  • 21
  • That is good but what if the payload is too large for a query string parameter, like a description field for example? – spadelives Jan 22 '13 at 17:45
  • If you need to use really long query strings you can change your config to handle it: http://stackoverflow.com/questions/8159321/request-exceeds-the-configured-maxquerystringlength-when-using-authorize Personally I don't like long qs, there is almost always a way to do it in a better way. – free4ride Jan 25 '13 at 09:10