Results 1 to 10 of 10

Thread: Upload limit in database

  1. #1
    Join Date
    Jun 2007
    Location
    DeKalb, IL
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Upload limit in database

    I took over someone else's PHP/MySQL webapp so I'm trying to understand how/why he did things.

    We have an upload form for a syllabus. He had the limit at 2 MB. I have upped that to 5 MB. Here's the code.

    Code:
    <form enctype="multipart/form-data" action="uploadSyllabus.php" method="POST">
    <input type="hidden" name="MAX_FILE_SIZE" value="5242880" />
    Send this file: <input name="userfile" type="file" id="userfile" />
    <input type="submit" value=" Upload File " />
    </form>
    However, no files over the size of 2 MB will upload now. I have looked through the uploadSyllabus.php and there's no mention of the 2 MB limit (besides error messages).

    The file is uploaded to our web server and the name is stored in the database. Is there a way to limit the upload amount somewhere else? I really figured this would be an easy change but it's proving to me otherwise!

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    In the php config the max post upload size i think by default is 2mB there are also some other settings in there. Look at your php.ini file.
    Corrections to my coding/thoughts welcome.

  3. The Following User Says Thank You to bluewalrus For This Useful Post:

    lindsaycb (01-14-2011)

  4. #3
    Join Date
    Jun 2007
    Location
    DeKalb, IL
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I should mention, I also have another upload form that the limit is 3 MB. I changed that to 20 MB, still didn't take. And it's done the exact same way as the syllabus section.

  5. #4
    Join Date
    Jun 2007
    Location
    DeKalb, IL
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I take that back!! The 3 MB file uploader is also not working! Found something 2.5 MB and it's also blocked. Thanks for the info! I didn't know there was a limit on upload size!

  6. #5
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    http://php.net/manual/en/ini.core.php

    The name is actually "upload_max_filesize".
    Corrections to my coding/thoughts welcome.

  7. #6
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    Adding on to what bluewalrus said, it may be worthwhile also looking at what value is stored in "post_max_size".

    You need this value to be at least equal or greater than the "upload_max_filesize" value, otherwise the file won't upload properly.

  8. #7
    Join Date
    Jun 2007
    Location
    DeKalb, IL
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Yep, after doing a quick Google search on the upload_max_filesize, I also asked my IT department to upp both options; just in case.

  9. #8
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    I do not have much knowledge about database storage limits for other webhost providers, but with my GoDaddy hosting service all databases, no matter the plan, has a storage capacity of 1GB each. With many files being uploaded at 5mb each you may fill up your database quickly before you will need to start on another database.
    To choose the lesser of two evils is still to choose evil. My personal site

  10. #9
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    That's why file names or IDs should be stored in the database and the files should be stored separately, as files, where there is no limit on the space (at least not as strict a limit as in the database).
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  11. #10
    Join Date
    Jun 2010
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Also asking a database to index files is somewhat cruel and will slow down any queries.

Bookmarks

Posting Permissions

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