I have a wordpress site where I want users to be able to upload files to the api url of a separate server called Server2.
I have been able to get this to work in two separate ways, but each has it's drawbacks.
Option 1) Redirecting back to the page itself on the action of the form allows me to submit via curl on the post and upload the file to Server2, but first it uploads the files to the temp location on the webserver. The webserver is limited in the size of files it can transfer and it also involves sending the file twice.
Option 2) Set the action of the form to the receiving url on Server2. Works well with the file upload and we don't run into the size limitation, but on the completion of the upload, the page goes to the url of Server2 and displays the result message from the upload. I don't have access to Server2 to redirect back.
I would like to be able to post the file to Server2 without actually going to the page as we do with curl, without having to upload the file to the webserver first. Is this possible?