开发者

Uploading files different servers at once using a single html Form

开发者 https://www.devze.com 2022-12-21 19:45 出处:网络
Is there a way to make a form where it can simultaneously upload to several servers at once? Currently in my web application, I am asking the users to type in some info + select a few files to uploa

Is there a way to make a form where it can simultaneously upload to several servers at once?

Currently in my web application, I am asking the users to type in some info + select a few files to upload.

  • Title, Description, Info, etc
  • File 0
  • File 1
  • File 2
  • File ...

On the backend, I'm using Pylons. Currently it accepts POST of (info + all files), processes the info and the first file (file 0), and uploads them again to Amazon S3. I only need to process info and the 'file 0' on my own server, the rest of the files I can pass through directly to S3 via a POST.

Is there a way to make a form开发者_JS百科 where the info+file0 will be POST'ed to one server, and the rest of the files be POST'ed directly to S3?


While you could employ JavaScript trickery to make clicking on a submit button result in multiple POST requests to multiple servers, such a solution will almost certainly cause more problems than it solves. You should probably stick with your current method.


Check this and this out.

My solution would involve ajax upload(s) to S3 as a first step. Once you're done with the files, you can submit all the other fields (not ajax) to your webserver, eventually adding the generated S3 links.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号