<p>I got a webserver with a running application. There's a webpage with a form: some text data and a file upload field. Now, what I would like to have is it working like this:<br>
The file is sent to the dedicated server, diffrent then the one application is running on. The server should return some kind of path (or anything that identifies the uploaded and saved file and allows to create an URL). Then, both this path and user-filled data should be submitted to the webserver with application, for any kind of database storage.</p>

<p>Problem is, there are 2 diffrent servers, so I can't upload the file with javascript, can I? Another way would be just to use <code>iframe</code> and put the upload form in there - but then I think I can't access the result of the upload (still inside the iframe) with javascript to pass the file path to my main server.</p>

<p>I could also just upload the file to same server my application is running on and then just <code>rsync</code> it to the other one - but I'd like to avoid it if I can, trying to minimalize the traffic actually :)</p>

<p>How do you handle such thing in your applications? </p>

[{'answer_id': 63182, 'author': 'David Thibault', 'author_id': 5903, 'author_profile': 'https://Stackoverflow.com/users/5903', 'pm_score': 1, 'selected': True, 'text': '<p>POST to dedicated server, server stores image and calls back to web server through a web service or other to give it any info required.</p>\n'}, {'answer_id': 63205, 'author': 'Ilya', 'author_id': 7566, 'author_profile': 'https://Stackoverflow.com/users/7566', 'pm_score': 1, 'selected': False, 'text': '<p>If you used an iframe, you could submit the upload form to the dedicated image server, and in the case of a successful result, have it in turn load a page from the original server with the info (eg. image path) "passed along" as a GET parameter.</p>\n'}]
['https://Stackoverflow.com/questions/63146', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4172/']