Menu

Order of post params

Michal
2013-10-16
2015-02-16
  • Michal

    Michal - 2013-10-16

    Hi guys,

    I was thinking to use GWT Uploader to upload files to Amazon S3, however there is an issue with xhr level 2 and form data ordering. S3 requires all post params to be before the file part however in Uploader native javascript code the file is added to FormData first and then the rest of custom post params.

    Maybe this could be other way around or configurable.

    Thanks
    Michal

     
  • Shawn Quinn

    Shawn Quinn - 2013-10-17

    Thanks for the heads up on this. Have you already tried swapping the logic around in the org.moxieapps.gwt.uploader.client.Uploader.nativeStartAjaxUpload() method to see if that fixes the issue? And if so, could you post a quick patch of what it looked like after the change? We can then look into either swapping that logic in the next release, or considering adding a new configuration option.

     
  • Michal

    Michal - 2013-10-17

    Yes, I tried swapping the logic and the upload worked (I'm still trying to come up with complete solution that would fit my needs though).

    var formData = new FormData();
    
    // Append on any post params
    if(postParams != null) {
      for (var key in postParams) {
        formData.append(key, postParams[key]);
      }
    }
    
    formData.append(filePostName, file);
    
     
  • Tino Desjardins

    Tino Desjardins - 2015-02-16

    I am also interested in this fix. But how it seems it is not in the codebase yet. Are there plans for further development of this library? Because the issue is older than 1 year.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.