Trying to process a file send by curl

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Trying to process a file send by curl

Post 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!!!
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: Trying to process a file send by curl

Post by yacahuma »

It was the upload_max_size on php.ini. I just wasted 10 hours of my life. The most stupid thing. AHHHHHHHHH
Post Reply