I have this file upload script that seems to work perfectly. The only problem is, when I upload a large file the server returns a 500 server error. What is all that about? Hope you can help. Thanks.
Thats what I thought, it takes a long time and therefore returning the error. is there a setting that i can change for execution time ?
If you have access to the php.ini file then you can change this. Also note that you might have to increase the maximum upload limit as well.
Maybe your host doesnt need a 777 chmod at the place u upload ur files make this 755 and try if the error still exist
My host has dissabled that code for security reasons so I place: php_value max_execution_time 100 in my .htaccess file and I am still getting the error with the files
You will need to contact your host - what is the size of the file that's being uploaded & furthermore, have you checked through php_info what your max execution time is? Try this at the top of your Script: ini_set('max_execution_time', 0); Code (markup):
"ini_set('max_execution_time', 0);" No, that didnt work. hmmmmmmm and the exicution time is at the default of 30 seconds but I have got 100 seconds in my .htaccess file
Ahh, ive just spoken to my host and they have a max of 2megs and it cant be changed. (sigh) There is a saying: there is always a way... is that the case here?
Maybe somebody could provide you with a hack around it, but it's pretty likley to get you banned from your host as soon as they find out. Alternative is to host the uploaded files elsewhere, or uprgrade/change with your original host. There are many hosting sites out there some paid some free for your files, but be careful to check out whether they allow hotlinking, file sizes, file types etc because nothing is for free in this world What are you allowing your users to upload pictures, music, anything they want?
ok thanks for that. err flash files mainly. I think that finding an external place to host files is the best option.
There are several other settings besides max_execution_time that can cause uploading problems. Try increasing these settings especially when uploading using post. max_input_time = 300 memory_limit = 128M post_max_size = 256M upload_max_filesize = 256M