Search code examples
phpformsurlsubmitexternal

PHP File upload external url


I have build a form in which you can add images. Unfortunatelly, I am not able to call "move_uploaded_file" in PHP, as the server is running PHP safe mode and there is no way to modify this (I have checked). Therefore, I submit my form to my OWN server, which handles the file uploading.

On my own server, the file however; is not found. I think it has to do with the form calling the external url. I know this because

echo $_FILES['uploadFile']['name'] ."<br>";

returns just an empty line.

The form itself is:

<form action="http://ejw.patrickh.nl/load.php" method="get" enctype="multipart/form-data" onsubmit ="return checkInput();"> </form>

and contains several input buttons.

Bottomline: the form on my own server submits the file perfectly, however when I make use of the form which is on another site, with the above action; no file is found.

Can this be fixed, and if so; how?

Thanks in advance!


Solution

  • You have to use method="post" to submit files.

    Also the enctype attribute alone can be used only, if method="post".