Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Mar 2008
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problem uploading files over 2MB

    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

    Thanks
    David

  • #2
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    make sure FULL error_reporting() is on.

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    New Coder
    Join Date
    Mar 2008
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!!

    please help!

  • #5
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,043
    Thanks
    2
    Thanked 316 Times in 308 Posts
    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.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #6
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #7
    New Coder
    Join Date
    Mar 2008
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!

  • #8
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,043
    Thanks
    2
    Thanked 316 Times in 308 Posts
    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.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •