I have the following HTML form:
<form enctype="multipart/form-data" id="upload_form" role="region" action="remoteUpload2.php?command=FileUpload&type=Files&currentFolder=%2F&langCode=en&hash=8e402b8b9927640d&" method="POST" target="ckf_19">
<input name="upload" type="file">
<input value="Upload Selected File" type="submit">
<input name="cancel" value="Cancel" type="button">
</form>
When I submit it, if I do a print_r($_FILES) I get the following output:
Array
(
[upload] => Array
(
[name] => logo.png
[type] => image/png
[tmp_name] => /tmp/phpvIFI0K
[error] => 0
[size] => 12201
)
)
What I am trying to figure out is how to send a file the same way, using only PHP, to connect two different systems together. I can modify the sending script, but not the receiving script, so I need to send data in the format that is expected.
Is there a way using cURL for me to post data to this script that will result in similar output for $_FILES? I have the file I want to send on the server, I just need to figure out how to POST it to the receiving script.