17 Replies Latest reply on Apr 22, 2009 9:17 AM by kiz1

    Need upload_max_filesize help!

    921creative Level 1
      Hi there,

      Ran into a little file upload problem tonight. I have the File Upload trigger on my page set to allow a 100000 KB (100 MB) file size. I then try uploading a 2.1 MB file with my form. I continue to get the following error:

      File upload error: Error uploading file. The uploaded file exceeds the upload_max_filesize directive in php.ini. (FILE_UPLOAD_ERROR)

      My question is, where do I access the php.ini file so I can change this filesize directive, which apparently doesn't allow anything over 2 MB? Is this something I need to ask my web host?
        • 1. Re: Need upload_max_filesize help!
          Günter Schenk Level 4
          Hi Brian,

          please try with adding this @ line 1:



          This directive should temporarily increase the upload_max_filesize value to 8 MB, but if it doesn´t work at all, you´ll indeed have to contact the host admin

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: Need upload_max_filesize help!
            921creative Level 1
            Thanks for your reply Gunter,
            I discovered that adding an .htaccess file to my web root with the upload_max_filesize set to the desired size worked perfectly, but I appreciate your tip!
            • 3. Re: Need upload_max_filesize help!
              I'm having the same problem with upload size, your .htaccess solution sounds <br />like the solution I'm looking for.<br />I would appreciate it if could tell me what exactly was the text of the <br />.htaccess file you created?<br /><br />Jeff<br /><br /><adobebrian@adobeforums.com> wrote in message <br />news:59b7a890.1@webcrossing.la2eafNXanI...<br />> Thanks for your reply Gunter,<br />> I discovered that adding an .htaccess file to my web root with the <br />> upload_max_filesize set to the desired size worked perfectly, but I <br />> appreciate your tip!
              • 4. Re: Need upload_max_filesize help!
                Günter Schenk Level 4
                Hi Sambo,

                not Brian, however...

                -------
                I would appreciate it if could tell me what exactly was the text of the
                .htaccess file you created?
                -------

                example: php_value upload_max_filesize 50M

                Cheers,
                Günter Schenk
                Adobe Community Expert, Dreamweaver
                • 5. Re: Need upload_max_filesize help!
                  Level 1
                  Thank You Gunter<br /><br />Jeff<br /><br /><Günter_Schenk@adobeforums.com> wrote in message <br />news:59b7a890.3@webcrossing.la2eafNXanI...<br />> Hi Sambo,<br />><br />> not Brian, however...<br />><br />> -------<br />> I would appreciate it if could tell me what exactly was the text of the<br />> .htaccess file you created?<br />> -------<br />><br />> example: php_value upload_max_filesize 50M<br />><br />> Cheers,<br />> Günter Schenk<br />> Adobe Community Expert, Dreamweaver
                  • 6. Re: Need upload_max_filesize help!
                    Günter Schenk Level 4
                    Hi Jeff,

                    just in case your host has disabled using .htaccess files, you´ll need to try with the "ini_set" approach mentioned above

                    Cheers,
                    Günter Schenk
                    Adobe Community Expert, Dreamweaver
                    • 7. Re: Need upload_max_filesize help!
                      921creative Level 1
                      Gunter, while the .htaccess method worked for uploading files over 2 MB, my uploads seem to time out after a few minutes when uploading files over 10 MB. Is there a way to increase the time allowed before a timeout occurs?
                      • 8. Re: Need upload_max_filesize help!
                        Günter Schenk Level 4
                        Hi Brian,

                        -----
                        Is there a way to increase the time allowed before a timeout occurs?
                        -----

                        try with tweaking the value of the php.ini directive "max_execution_time"

                        Here´s some more info on how to define this (plus some other relevant settings) in a .htaccess file: http://roshanbh.com.np/2008/01/uploading-larger-files-in-php.html

                        Cheers,
                        Günter Schenk
                        Adobe Community Expert, Dreamweaver
                        • 9. Re: Need upload_max_filesize help!
                          Level 1
                          Another way to do this if your web host does not allow changing it by <br />.htaccess is to create a php.ini file and place it in the public_html folder<br /><br />here is an example of the php.ini file:<br /><br />php_value upload_max_filesize 100M<br />php_value post_max_size 100M<br /><br /><br />Jeff<br /><br /><br /><adobebrian@adobeforums.com> wrote in message <br />news:59b7a890.-1@webcrossing.la2eafNXanI...<br />> Hi there,<br />><br />> Ran into a little file upload problem tonight. I have the File Upload <br />> trigger on my page set to allow a 100000 KB (100 MB) file size. I then try <br />> uploading a 2.1 MB file with my form. I continue to get the following <br />> error:<br />><br />> File upload error: Error uploading file. The uploaded file exceeds the <br />> upload_max_filesize directive in php.ini. (FILE_UPLOAD_ERROR)<br />><br />> My question is, where do I access the php.ini file so I can change this <br />> filesize directive, which apparently doesn't allow anything over 2 MB? Is <br />> this something I need to ask my web host?
                          • 10. Re: Need upload_max_filesize help!
                            dizmarkie Level 1
                            Yes this can work to only if your PHP is running in CGI. If it is running as an ISAPI module this I dont think will work. I've also seen it only works for PHP 4.. not sure if that is the case...

                            If you have a control panel and can change your php to CGI.. then placing a customized php.ini will work if it its in your httpdocs folder
                            • 11. Re: Need upload_max_filesize help!
                              kiz1
                              hi gunter
                              i have been experiencing problems with file upload. I have the File image Upload trigger on my page set to allow a 104857600 KB (100 MB) file size. I then try uploading a 2.1 MB file with my form. I continue to get the following error:

                              File upload error: Error uploading file. The uploaded file exceeds the upload_max_filesize directive in php.ini. (FILE_UPLOAD_ERROR)

                              if i load a file less than 1 mg the loader works, i have been using MAMP as my local host and have changed the php.ini file to 1G in both php5 and php 4
                              i also created a htaccess file with these settings:

                              php_value upload_max_filesize 104857600 KB
                              php_value post_max_size 104857600 KB
                              php_value max_execution_time 104857600
                              php_value max_input_time 104857600

                              and have placed it in /Applications/MAMP/htdocs/max_file_upload.htaccess

                              but still i have the same error please can you help!
                              CJ Taylor
                              • 12. Re: Need upload_max_filesize help!
                                Günter Schenk Level 4
                                Hi CJ,

                                possibly a dumb question, but -- did you restart the Apache server after modifying the php.ini ?

                                Cheers,
                                Günter Schenk
                                Adobe Community Expert, Dreamweaver
                                • 13. Re: Need upload_max_filesize help!
                                  kiz1 Level 1
                                  yes i did
                                  • 14. Re: Need upload_max_filesize help!
                                    kiz1 Level 1
                                    hi gunter <br /> <br />here is the script for the file if that helps <br /> <br /><?php require_once('Connections/nbcolvod.php'); ?> <br /><?php<br />// Load the common classes<br />require_once('includes/common/KT_common.php');<br /><br />// Load the tNG classes<br />require_once('includes/tng/tNG.inc.php');<br /><br />// Make a transaction dispatcher instance<br />$tNGs = new tNG_dispatcher("");<br /><br />// Make unified connection variable<br />$conn_nbcolvod = new KT_connection($nbcolvod, $database_nbcolvod);<br /><br />// Start trigger<br />$formValidation = new tNG_FormValidation();<br />$tNGs->prepareValidation($formValidation);<br />// End trigger<br /><br />//start Trigger_ImageUpload trigger<br />//remove this line if you want to edit the code by hand <br />function Trigger_ImageUpload(&$tNG) {<br />  $uploadObj = new tNG_ImageUpload($tNG);<br />  $uploadObj->setFormFieldName("Filedata");<br />  $uploadObj->setDbFieldName("filename");<br />  $uploadObj->setFolder("movies/");<br />  $uploadObj->setMaxSize(104857600);<br />  $uploadObj->setAllowedExtensions("gif, jpg, png, m1v, m2a, m2v, mov, mp3, mpa, flv");<br />  $uploadObj->setRename("auto");<br />  return $uploadObj->Execute();<br />}<br />//end Trigger_ImageUpload trigger<br /><br />//start Trigger_Redirect trigger<br />//remove this line if you want to edit the code by hand<br />function Trigger_Redirect(&$tNG) {<br />  $redObj = new tNG_Redirect($tNG);<br />  $redObj->setURL("thankyou.html");<br />  $redObj->setKeepURLParams(false);<br />  return $redObj->Execute();<br />}<br />//end Trigger_Redirect trigger<br /><br />// Make an insert transaction instance<br />$ins_blob = new tNG_insert($conn_nbcolvod);<br />$tNGs->addTransaction($ins_blob);<br />// Register triggers<br />$ins_blob->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");<br />$ins_blob->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);<br />$ins_blob->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "FILES", "Filedata");<br />$ins_blob->registerConditionalTrigger("{GET.isFlash} != 1", "END", "Trigger_Redirect", 90);<br />$ins_blob->registerTrigger("AFTER", "Trigger_ImageUpload", 97);<br />$ins_blob->registerConditionalTrigger("{GET.isFlash} == 1", "ERROR", "Trigger_Default_MUploadError", 10);<br />$ins_blob->registerTrigger("END", "Trigger_Default_Redirect", 99, "thankyou.html");<br />// Add columns<br />$ins_blob->setTable("`blob`");<br />$ins_blob->addColumn("clip_number", "NUMERIC_TYPE", "VALUE", "{GET.clip_number}");<br />$ins_blob->addColumn("filename", "FILE_TYPE", "POST", "");<br />$ins_blob->addColumn("blobfield", "STRING_TYPE", "POST", "blobfield");<br />$ins_blob->setPrimaryKey("clip_number", "NUMERIC_TYPE");<br /><br />// Execute all the registered transactions<br />$tNGs->executeTransactions();<br /><br />// Get the transaction recordset<br />$rs_blob_ = $tNGs->getRecordset("`blob`");<br />$row_rs_blob_ = mysql_fetch_assoc($rs_blob_);<br />$totalRows_rs_blob_ = mysql_num_rows($rs_blob_);<br /><br />// Multiple Upload Helper Object<br />$muploadHelper = new tNG_MuploadHelper("", 32);<br />$muploadHelper->setMaxSize(104857600);<br />$muploadHelper->setMaxNumber(0);<br />$muploadHelper->setExistentNumber(0);<br />$muploadHelper->setAllowedExtensions("gif, jpg, png, m1v, m2a, m2v, mov, mp3, mpa, flv");<br /><br />// Multiple Upload Helper Object<br />$muploadHelper = new tNG_MuploadHelper("", 32);<br />$muploadHelper->setMaxSize(1048576);<br />$muploadHelper->setMaxNumber(0);<br />$muploadHelper->setExistentNumber(0);<br />$muploadHelper->setAllowedExtensions("gif, jpg, png, m1v, m2a, m2v, mov, mp3, mpa");<br />?> <br /> <br /> <br /> <br /> <br /> <br /> <script src="includes/common/js/base.js" type="text/javascript"></script> <br /> <script src="includes/common/js/utility.js" type="text/javascript"></script> <br /> <script src="includes/skins/style.js" type="text/javascript"></script> <br /><?php echo $tNGs->displayValidationRules();?><?php echo $muploadHelper->getScripts(); ?> <br /> <!--<br />.style1 {color: #FF6600}<br />.style3 {font-size: 24px;<br /> font-weight: bold;<br /> color: #000066;<br />}<br />.style4 {font-size: 12px;<br /> color: #000066;<br />}<br />--> <br /> <br /> <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script> <br /> <br /> <br /> <br /> <p align="center" class="style3"> <font face="Arial, Helvetica, sans-serif"> <br /> <script type="text/javascript"></script>AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9 ,0,28,0','width','753','height','48','accesskey','4','tabindex','4','title','broadcast upload form','src','nbcol banner','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download. cgi?P1_Prod_Version=ShockwaveFlash','movie','nbcol banner' ); //end AC code <br /></font> <br /> <noscript> <br /> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0 ,28,0" width="753" height="48" accesskey="4" tabindex="4" title="broadcast upload form"> <br /> <param name="movie" value="nbcol banner.swf" /> <br /> <param name="quality" value="high" /> <br /> <embed src="nbcol%20banner.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=Shockwa veFlash" type="application/x-shockwave-flash" width="753" height="48" /> <br /></object> <br /></noscript> <br /></p> <br /> <p align="center"> <font face="Arial, Helvetica, sans-serif"> <span class="style4">Material uploaded to this facility must conform to the college accceptable use policy, see disclaimer below for further information</span> </font> <font color="#FF6600" size="2" face="Arial, Helvetica, sans-serif">.</font> </p> <br /> <p align="center"> <strong> <span class="style1"> <font face="Arial, Helvetica, sans-serif">ERA:</font></span></strong> <span class="style1 style1"> <font size="2" face="Arial, Helvetica, sans-serif">when uploading Resource material this section must be completed in fu</font> </span> <span class="style1"> <font size="2" face="Arial, Helvetica, sans-serif">ll</font> </span> <font color="#000000" size="2"> <br /> <br /> </font></p> <br /> <p></p> <br /> <p>&#160;</p> <br /> <p align="center"> <br /> <?php<br /> echo $tNGs->getErrorMsg();<br />?> <br /> <?php<br />// Multiple Upload Helper<br />echo $tNGs->getSavedErrorMsg();<br />echo $muploadHelper->Execute();<br />?> <br /></p> <br /> <p>&#160;</p> <br /> <p>&#160;</p> <br /> <p>&#160;</p> <br /> <br /> <br /> <br />cj
                                    • 15. Re: Need upload_max_filesize help!
                                      Günter Schenk Level 4
                                      Hi CJ,

                                      when changing the "upload_max_filesize" and "post_max_size" values via a .htaccess file, make sure you´re defining the values in M (aka MegaByte) and not in KB, example:

                                      php_value upload_max_filesize 120M
                                      php_value post_max_size 120M

                                      It´s also important to consider that any values for the other directives "max_execution_time" and "max_input_time" are meant to set *seconds*, so reusing the KB values you defined in ADDT´s Upload File behaviour doesn´t really make sense.

                                      Cheers,
                                      Günter Schenk
                                      Adobe Community Expert, Dreamweaver
                                      • 16. Re: Need upload_max_filesize help!
                                        kiz1 Level 1

                                        Hi gunter,

                                        again need help with htaccess.

                                        i have changed the  htaccess file to

                                        php_value upload_max_filesize 120M
                                        php_value post_max_size 120M
                                        php_value max_execution_time 30
                                        php_value max_input_time 60

                                        and the settings in php.ini

                                        but still am having little sucess.

                                        does the htacess file have to be on a live server to work?

                                        cj

                                        • 17. Re: Need upload_max_filesize help!
                                          kiz1 Level 1

                                          hi gunter
                                          i have still been experiencing problems with the file upload with save to database wizard. I have the File image Upload trigger on my page set to allow a 2097152KB (2G) file size. I then try uploading any file with my form. I continue to get error messages:

                                          error messages: skipping file wt6-1.mov. File size is 12352 kB and maximum allowed file size is 2097152

                                          skipping file Nandoweb.mov File size is 676 kB and maximum allowed file size is 2097152



                                          Now if i load any file  i still get error messages.

                                          i have been using MAMP as my local host and have changed the php.ini file to 2G in both php5 and php 4
                                          i also created a htaccess file with these settings:

                                          php_value upload_max_filesize 2097152 KB
                                          php_value post_max_size 2097152 KB
                                          php_value max_execution_time 30
                                          php_value max_input_time 60

                                          and have placed it in /Applications/MAMP/htdocs/max_file_upload.htaccess

                                          but still i have the same error please can you help again!

                                          thanks
                                          CJ