$_FILES comes up empty
Posted by: adamzwakk (---.cpe.net.cable.rogers.com)
Date: August 13, 2009 07:53PM

I have a form (and yes the enctype is set) and when I submit it, all the $_POST values come in, but nothing from $_FILES. It comes up as empty. I have another form that is almost identical on the same server and site and it works fine. But for some reason, if I try and send the same file through this other form.. it just comes up empty.

Any ideas?

Options: ReplyQuote
Re: $_FILES comes up empty
Posted by: toumimi (---.49.140-88.rev.gaoland.net)
Date: August 13, 2009 09:17PM

Hum. Many reasons...

a) Wrong enctype for the form => enctype=”multipart/form-data”
b) Method must be post (not get)
c) File uploads are disabled (wamp menu -> PHP -> PHP settings
d) File too big => increase postmaxsize and uploadmax_filesize
e) Not enough rights to create the file (to uploadtmpdir)
f) File input don't have a name
.....


For your case, it's probably the size or the setting...

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Options: ReplyQuote
Re: $_FILES comes up empty
Posted by: adamzwakk (---.cpe.net.cable.rogers.com)
Date: August 13, 2009 09:20PM

I can upload the same file on almost exact same form on the same server just fine though..

Options: ReplyQuote
Re: $_FILES comes up empty
Posted by: toumimi (---.49.140-88.rev.gaoland.net)
Date: August 13, 2009 09:26PM

Quote

almost exact same form

If configuration is not in fault, then it's your code...
Did you test this code to see if it is really empty (not a name error) ?
print_r($_FILES)

Else check your code to see if there is no problem even really small (double letter, etc)

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Options: ReplyQuote
Re: $_FILES comes up empty
Posted by: adamzwakk (---.cpe.net.cable.rogers.com)
Date: August 13, 2009 09:35PM

yes I did a print_r($_FILES) and it was empty. The only difference is the function that it leads to, which shouldnt matter cause the one that DOES work, leads to the same function page, and works beautifully.

Options: ReplyQuote
Re: $_FILES comes up empty
Posted by: toumimi (---.49.140-88.rev.gaoland.net)
Date: August 13, 2009 09:47PM

If there is an error while uploading, then the global var $_FILES will contain the field name and an error as described here : [www.php.net]

Here are some common ptitfalls: [www.php.net]

Find your answer here...

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Options: ReplyQuote


Sorry, only registered users may post in this forum.