PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Tue Jun 27, 2017 3:55 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Jan 11, 2017 10:23 pm 
Offline
Forum Regular
User avatar

Joined: Sun Jul 01, 2007 7:11 am
Posts: 870
I have a web service like

Syntax: [ Download ] [ Hide ]
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!!!


Top
 Profile  
 
PostPosted: Wed Jan 11, 2017 10:45 pm 
Offline
Forum Regular
User avatar

Joined: Sun Jul 01, 2007 7:11 am
Posts: 870
It was the upload_max_size on php.ini. I just wasted 10 hours of my life. The most stupid thing. AHHHHHHHHH


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group