On Friday 12 July 2002 03:27, Tyler Longren wrote: > Hi, > > I have a form: > <input type=file name=pdfFile> > > And the code that processes the form: > if ($_FILES['pdfFile']['name'] == "") { > print "You must select a file to upload"; > } > else { > // code to add data to db > } > > This works on my server at home (when I select a file to upload, it sees > the filename in $_FILES['pdfFile']['name'], but on a server at work, > it's blank so I see the error "You must select a file to upload". > > Any ideas on why this might happen? Is there anything in php.ini that > could be wrong (it works here at home when register_globals is set to on > or off)?
What would help is what version(s) of php are you using? Things to check: If php < 4.1.X then $_FILES[] is not available, use $HTTP_POST_FILES[], If upload fails for any reason then (I believe), $_FILES['pdfFile']['name'] would be empty. So: php.ini --> upload enabled? Are the other settings governing uploads set to reasonable values? Check manual > Handling file uploads > Common Pitfalls to see what these settings are. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Machines that have broken down will work perfectly when the repairman arrives. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php