Empty $_FILES when uploading file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
webgal
Forum Newbie
Posts: 2
Joined: Mon Feb 25, 2008 4:43 pm

Empty $_FILES when uploading file

Post by webgal »

There has to be some absurdly simple answer to this dilemma that I'm missing but if you all would indulge me and throw a little knowledge my way I'd be grateful. I'm attempting to upload a file. I have set my form enctype to multi-part/form-data but when I submit (method=POST) my $_FILES array is empty. My new ISP tells me there is a 6MB limit on file size with a 60 second timeout. I'm trying to upload a tiny file (120k). Any ideas?

Thanks,
User avatar
EverLearning
Forum Contributor
Posts: 282
Joined: Sat Feb 23, 2008 3:49 am
Location: Niš, Serbia

Re: Empty $_FILES when uploading file

Post by EverLearning »

If you wrote this in your code
webgal wrote:multi-part/form-data
then that's the error. It should be

Code: Select all

multipart/form-data
without the dash in 'multipart'.
webgal
Forum Newbie
Posts: 2
Joined: Mon Feb 25, 2008 4:43 pm

Re: Empty $_FILES when uploading file

Post by webgal »

Thank you so much. I knew it had to be something really stupid. That works great.
User avatar
EverLearning
Forum Contributor
Posts: 282
Joined: Sat Feb 23, 2008 3:49 am
Location: Niš, Serbia

Re: Empty $_FILES when uploading file

Post by EverLearning »

This kind of thing happens to everyone once in a while, no matter how long they've been coding. :)
Post Reply