Menu

Attachment: File size question

Help
James
2008-05-16
2013-06-03
  • James

    James - 2008-05-16

    I'm creating a form and allowing users to upload a file. The question i have is how do i specify the file size limit? I'm using the phpFormGenerator 3.0 and it has a field called : File size limit. I'm trying to make the limit 10mbs, so i put the number 10.00. However, when trying to upload a file of size 7mbs, it gives me an error and says "File _____ was not uploaded", when i try a smaller file, it goes through.

    Any ideas?

     
    • TNTEverett

      TNTEverett - 2008-05-16

      As far as I can tell this is an unimplemented feature.  I will look at what it takes to implement it in your code.  Will you send me you processor.php code in an email?

       
    • TNTEverett

      TNTEverett - 2008-05-16

      If you care to do modifications yourself here is a good example.
      http://www.phpeasystep.com/workshopview.php?id=3

       
    • James

      James - 2008-05-16

      i sent you the processor.php, ill look at that link. ty

       
      • TNTEverett

        TNTEverett - 2008-05-17

        Inserted code as shown in the example.  It should work for you.  I replied to your email so you should have already received it. 

         
    • Marianne Yates

      Marianne Yates - 2008-06-05

      Would you guys mind sharing the solution to this because I can't seem to get anything to upload. I already checked with my host and my file permissions are set. I did get a file to upload once a long time ago, but now nothing seems to.

      I just created a test form with one field: an upload field and i set the file size to 50000. Is that bytes? Even still I uploaded a file that was only 4KB and it wouldn't upload.

      Also where in the code does it specify what the file size limit is? The first form I did a while ago, I think i specified 20000 for file size and my test one today is 50000, but i don't see any difference between the code for each form.

       
      • TNTEverett

        TNTEverett - 2008-06-05

        File size limits can be set in multiple places. 
        Your web host may impose file size limits based on your "hosting package".
        Limits can be set using a unique copy of the php.ini file for your site.
        You can set additional limits within your own code that override (smaller only) the ini file. 

        Create this file and point your browser to it to see what your host is limiting the file size to.  There is alot of information here but you will find the file size limit somewhere. 

        Filename: phpenv.php
        <?php
        phpinfo();
        ?>

        There are many ways to accomplish file upload size limits.  Without researching all the possibilities and then guessing on how to implement it on your form your best bet is to create that simple form, find where the limit is being checked then set a small number and start checking how big of a file you can actually upload.  Once you find the threshold you can determine if the limit number represents Bytes, KBytes, or something else.  Then just set the number to the real file limit you want to impose on your users. 

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.