Jump to content

Upload problems. $_FILES has no data


jonoc33

Recommended Posts

I've made an upload form/script for one of my websites yet whenever I upload, $_FILES contains no data in it at all (i've done print_r($_FILES)). I've also done ini_set("upload_file_maxsize", "10M"); AND ini_set("post_file_maxsize", "10M"); to make sure that the max size of uploads doesn't mess it up.

 

I know it's something to do with the size because if I upload a significantly smaller file it works.

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/148729-upload-problems-_files-has-no-data/
Share on other sites

i am fairly sure you can't use ini_set on upload_file_maxsize or post_file_maxsize as ini_set takes effect when the command is called

and so it takes the values  from the ini file at the start checks them then decides if it will add it to $_FILES.

you will need to change these values in you php.ini file

 

Scott.

don't know if you hosting will support this but is possible to set ini directives from .htaccess

i have never used it so i don't know how they effect file uploads or if they would be able to solve your problem

i haven't used them before but you should find a tutorial with a quick google

 

Scott.

The $_FILES array will be empty if your form is invalid, if uploads are not enabled on your server, or if you exceed the post_max_size setting.

 

What is the code for your form, use a phpinfo(); statement to check if uploads are enabled and to find the post_max_size setting and what is the size of the upload file you are testing with?

 

And you cannot set the upload size settings (which are upload_max_filesize and post_max_size, I'm not sure where you got the two you were trying) using ini_set() statements as stated by ratcateme and also found in the php documentation.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.