03-11-2008, 05:24 PM
hey hopefully someone can help me with this problem, i have the scripts for uploading a file to a mysql database and they are working fine with all files under 2MB but the minute i try uploading a file which is over 2MB it just doesnt work, does not even give me an error message
if someone may know what to do, i would be greatful for you help
03-11-2008, 05:27 PM
make sure FULL error_reporting() (http://php.net/error_reporting) is on.
03-11-2008, 05:40 PM
Usually the max_upload_size is set to 2mb. Run phpinfo(); to see what yours is set at. You can try using htaccess or a php.ini file to override the value.
03-11-2008, 07:50 PM
hey, cheers for your help. i did php info and it says the max file size is 32M so i dont think it can be that, is there anything else it could be that is restricting my upload?
i have just checked and i actually cant upload any file over 1M!!
03-11-2008, 08:02 PM
Reading the upload section in the manual will help - http://www.php.net/manual/en/features.file-upload.php
It lists all the settings that affect uploads and it shows the possible values of the ['error'] element that your code should be testing so your code can report to you why an upload failed.
03-11-2008, 10:04 PM
You'll have to modify the max_file_upload_size parameter in the php.ini file... If you're on shared hosting, you proly can't change that parameter... Otherwise there should be a file called php.ini in your root dir that you need to locate the aforementioned parameter and modify it.
If you have problems, I'd contact your host about it.
03-11-2008, 10:22 PM
i have been looking on the net and it appears that is is something to do with the "max allowed packet", and from what i can gather this bit of code is stored in the my.ini file, where abouts is this file? i cant find it anywhere, or if it is not in there, where is the max allowed packet code???
any help much appreciated!
03-11-2008, 10:48 PM
The my.ini file is your mysql configuration file and it is normally in one of the mysql folders. You will only have access to this if you have administrator access to your server. If this is on a shared server, you would need to ask the hosting company to change the setting, but I doubt they will.
A database is not a file storage engine. Storing files in a database adds overhead processing that just slows everything down and in this case exceeds the amount of data that can be sent to and received from the msyql server at one time.