Page 1 of 1

Trying to process a file send by curl

Posted: Wed Jan 11, 2017 9:23 pm
by yacahuma
I have a web service like

Code: Select all

if (isset($_FILES["file"])){
    $filename = $_FILES['file']['tmp_name']);

   if (is_uploaded_file($filename))
     echo "is Uploaded";
   else
     echo "is NOT uploaded";
}
else{
  echo "is not set";
}

Then I call the webservice like so:

curl -i -F 'file=@/usr/home/mydomain/testfile.pdf' -F 'parm1=xxx' -F 'param2=123' http://anotherdomain/my_web_service.php


THE PROBLEM: I am ALWAYS getting "is NOT uploaded". From what I can tell
$_FILES["file"] IS SET
But it is empty

When I print $filename is always empty


I contacted the webservice from the command line(as above) and also by a php program using curl and I always get the same result

What bothers me even more is that is works on my local development machine. It does not work on the actual server. I ran out of ideas

HELP!!!

Re: Trying to process a file send by curl

Posted: Wed Jan 11, 2017 9:45 pm
by yacahuma
It was the upload_max_size on php.ini. I just wasted 10 hours of my life. The most stupid thing. AHHHHHHHHH