I have a web form that includes a file input (for a photo) and a text field (for a description).
When the user submits the form, I would like to POST the file to an API on another domain. The API call accepts binary file information. I was hoping to send the POST request via Ajax, but it seems it's not possible to send files via Ajax.
So, can I point the form directly at the API URL? The problem with this is what to do with the response: how can I handle a 200 response and forward the user to a 'success' page on my app, without Ajax?
Or do I need to do the POST in a server-side script instead?