changed upload file size to larger but larger files are not uploading

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ghghgh19
    Private First Class

    • May 2008
    • 8

    changed upload file size to larger but larger files are not uploading

    i put an upload file button on my website.

    i changed the upload file limit to 500000000

    the file i want to upload is 50mb

    when i uploaded it, it wasn't in my uploads folder.

    i uploaded a smaller file and it was there. i changed the script to accomodate for the larger file size but the file never added.

    why?

    how can i fix this?

    also when people upload a file to the site, it sends me an automatic email. however, the person who is sending the email comes up as 'unknown'. how do i change that so i know who is sending me the files?

    a quick reply is urgent
  • navaldesign
    General & Forum Moderator

    • Oct 2005
    • 12080

    #2
    Re: changed upload file size to larger but larger files are not uploading

    How can we answer you ?

    HOW did you change the max upload file size ?
    How do you upload the files ?

    What script are you using ?
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

    Comment

    • ghghgh19
      Private First Class

      • May 2008
      • 8

      #3
      Re: changed upload file size to larger but larger files are not uploading

      i followed the steps in the tutorial for BlueVoda on how to upload a file to website and it told me.

      this is the script

      <?php
      // Receiving variables
      @$email = addslashes($_POST['email']);
      @$upload_Name = $_FILES['upload']['name'];
      @$upload_Size = $_FILES['upload']['size'];
      @$upload_Temp = $_FILES['upload']['tmp_name'];

      // Validation for max file size
      if ($upload_Size>0)
      {
      if( $upload_Size >500000000)
      {
      //delete file
      unlink($upload_Temp);
      header("Location: error.html");
      exit;
      }
      $uploadFile = "uploads/".$upload_Name ;
      @move_uploaded_file( $upload_Temp , $uploadFile);
      chmod($uploadFile, 0644);
      $upload_URL = "http://www.yourmusiconnet.com/uploads/".$upload_Name ;
      }
      //Sending Email to form owner
      $mailto = "francisromano08********.com";
      $mailsubj = "Song added to site";
      $mailhead = "From: $email\n";
      reset ($HTTP_POST_VARS);
      $mailbody = "Here is my song you bitches :\n";
      while (list ($key, $val) = each ($HTTP_POST_VARS))
      {
      if ($key!="submit")
      {
      $mailbody .= "$key : $val\n";
      }
      }
      $mailbody .= "upload: $upload_URL\n";
      mail($mailto, $mailsubj, $mailbody, $mailhead);
      header("Location: thankyoupage.html");
      ?>

      this is what BlueVoda told us to use. We used it and it works for smaller files but large ones like full songs wont upload into the uploads folder. why? we changed the file size so larger ones can be added but they don't come through.

      Comment

      • navaldesign
        General & Forum Moderator

        • Oct 2005
        • 12080

        #4
        Re: changed upload file size to larger but larger files are not uploading

        Each server has it's own setings as for max filesize that you can upload, and you can't override this limit this way. So you can change the limit in the script, but only up to the max limit allowed by the server.
        Some VH servers are set to 12, some to 20, and last, some are set to 35 MB.

        The only way to find that out and actually set the limit to a larger number, is by using the phpinfo() command (to gather the info) and using yet another script to create a local php.ini file. This is quite easily done with a small script, that reads the server php.ini file, it changes whatever needs to be changed, and it then saves a copy of it in your own folder. Here it is:

        <!-- /* SCRIPT NAME: modify_php_ini.php */ -->
        <?php
        // Put all the php.ini parameters you want to change below. One per line.
        // Follow the example format $parm[] = "parameter = value";

        $parm[] = "upload_max_filesize = 50M";
        $parm[] = "post_max_size = 50M";
        // full unix path - location of the default php.ini file at your host
        // you can determine the location of the default file using phpinfo()
        $defaultPath = '/usr/local/lib/php.ini';
        // full unix path - location where you want your custom php.ini file
        //$customPath = "/path/php.ini";
        $customPath = "php.ini";
        // nothing should change below this line.
        if (file_exists($defaultPath)) {
        $contents = file_get_contents($defaultPath);
        $contents .= "\n\n; MODIFIED THE FOLLOWING USER PARAMETERS:\n\n";
        foreach ($parm as $value) $contents .= $value . " \n";
        if (file_put_contents($customPath,$contents)) {
        if (chmod($customPath,0600)) $message = "<b>PHP.INI File modified and copied.</b>";
        else $message = "PROCESS ERROR - Failed to upadate php.ini.";
        } else {
        $message = "PROCESS ERROR - Failed to write php.ini file.";
        }
        } else {
        $message = "PROCESS ERROR - php.ini file not found.";
        }
        echo $message;
        ?>


        Copy the above code, paste it in Notepad, save is as "modify_php_ini.php". Upload it on your server and run it (type in your browser "http://www.yourdomain.com/modify_php_ini.php")

        It will modify the allowable file size to 50 Mb. If you need less, change it to 10, 20 or 30M, whatever you need.

        It only affects your own site, not any other hosted on the same server.


        In the script, it is assumed that your php.ini path is '/usr/local/lib/php.ini'

        If you get from the script a message that php.ini was not found, use this other script:


        <?php
        phpinfo();
        ?>

        Upload it on your site as phpinfo.php and run it (http://www.yourdomain.com/phpinfo.php)

        It will display all your server php settings, and among them, you will be able to see your php.ini path and your max upload file size




        Tip: since a php.ini file locally saved is loaded each time a request takes place, if you only use it to override the file size issue, i suggest that you publish your form inside a dedicated folder, and also load this script and run it only for that folder. This way, when users visit your normal pages, in your public_html (or www, whatever it is named) folder, the local php.ini file is not loaded at all.
        Navaldesign
        Logger Lite: Low Cost, Customizable, multifeatured Login script
        Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
        DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
        Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

        Comment

        • ghghgh19
          Private First Class

          • May 2008
          • 8

          #5
          Re: changed upload file size to larger but larger files are not uploading

          thanks that worked

          but when people send me files it says 'unknown' as the sender in my email address

          is there a way to change that so i get their name as the sender?

          Comment

          • navaldesign
            General & Forum Moderator

            • Oct 2005
            • 12080

            #6
            Re: changed upload file size to larger but larger files are not uploading

            Probably because the email field in the form is NOT named "email" but something else (like "Email" or anything else).
            Navaldesign
            Logger Lite: Low Cost, Customizable, multifeatured Login script
            Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
            DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
            Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

            Comment

            • wesleyvinhvan
              Sergeant

              • Mar 2008
              • 21

              #7
              Re: changed upload file size to larger but larger files are not uploading

              Hello Navaldesign, I am trying to upload a file to my site using a form that VH provided:

              <?php
              // Receiving variables
              @$email = addslashes($_POST['email']);
              @$upload_Name = $_FILES['upload']['name'];
              @$upload_Size = $_FILES['upload']['size'];
              @$upload_Temp = $_FILES['upload']['tmp_name'];

              // Validation for max file size
              if ($upload_Size>0)
              {
              if( $upload_Size >500000000)
              {
              //delete
              file
              unlink($upload_Temp);
              header("Location: error.html");
              exit;
              }
              $uploadFile = "uploads/".$upload_Name ;
              @move_uploaded_file( $upload_Temp , $uploadFile);
              chmod($uploadFile, 0644);
              $upload_URL = "http://www.yourmusiconnet.com/uploads/".$upload_Name ;
              }
              //Sending Email to form owner
              $mailto = "francisromano08********.com";
              $mailsubj = "Song added to site";
              $mailhead = "From: $email\n";
              reset ($HTTP_POST_VARS);
              $mailbody = "Here is my song you bitches :\n";
              while (list ($key, $val) = each ($HTTP_POST_VARS))
              {
              if ($key!="submit")
              {
              $mailbody .= "$key : $val\n";
              }
              }
              $mailbody .= "upload: $upload_URL\n";
              mail($mailto, $mailsubj, $mailbody, $mailhead);
              header("Location: thankyoupage.html");
              ?>


              THE FUNCTION OF RETRIEVING THE INFORMATION FROM THE USER WORKS WELL, MY ONLY PROBLEM IS I DO NOT SEE THE FILE UPLOADED INTO THE FOLDER (UPLOADS) FROM THE USER. CAN YOU TELL ME WHAT I DID WRONG?

              Comment

              • navaldesign
                General & Forum Moderator

                • Oct 2005
                • 12080

                #8
                Re: changed upload file size to larger but larger files are not uploading

                Use the new form wizard, it has a script embedded that i built that can upload as many files as you like. If you need to change the default file size, which is 1 Mb, include in your orm a hidden field, named "filesize" with value the size you want in Kb (in example, for size = 2 Mb, the hidden field must have a value of "2048".
                Navaldesign
                Logger Lite: Low Cost, Customizable, multifeatured Login script
                Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                Comment

                • wesleyvinhvan
                  Sergeant

                  • Mar 2008
                  • 21

                  #9
                  Re: changed upload file size to larger but larger files are not uploading

                  Dear Naval, base on your answer above, I don't think that is my problem. My problem is "I can not see the file that being uploaded to my UPLOADS folder. Even though it did display the successful messege in the thankyou_page.html" Can you please enlighten me. Many thanks

                  Comment

                  • navaldesign
                    General & Forum Moderator

                    • Oct 2005
                    • 12080

                    #10
                    Re: changed upload file size to larger but larger files are not uploading

                    The above script supposes that you have already created the "uploads" folder and you have already set its permissions to 777. Did you ?

                    Also, what is the size of the file you are trying to upload ?

                    Is your upload field named "upload"? the script that you posted above requires that the upload field MUST be named "upload",

                    The good thing with specific scripts is that they allow experienced users to modify them/adapt them to specific needs. For generic purpose forms, it is better if you use scripts that will take care of the "details" themselves, as the new Form Processor that is embedded automatically in your form, or ABVFP
                    Navaldesign
                    Logger Lite: Low Cost, Customizable, multifeatured Login script
                    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                    Comment

                    • wesleyvinhvan
                      Sergeant

                      • Mar 2008
                      • 21

                      #11
                      Re: changed upload file size to larger but larger files are not uploading

                      Hi Naval, thank you for your quick response on this topic. Yes I did created a folder and name it "uploads" and I did change the permissions of the folder (uploads) to 777. I changed the filesize to 5Mb, but I don't know if the upload field is name upload or not. I don't think I change it, but I will check. I will let you know. Thank you so much for your help.

                      Comment

                      • wesleyvinhvan
                        Sergeant

                        • Mar 2008
                        • 21

                        #12
                        Re: changed upload file size to larger but larger files are not uploading

                        Hi Naval, after verifying your suggestion on the field name for "upload"; you are RIGHT, I did not have "upload" as a name for that filed, that was the cause to my problem. Thanks again for the many things you did on this support issue and for many others on this support forum.

                        Comment

                        • wesleyvinhvan
                          Sergeant

                          • Mar 2008
                          • 21

                          #13
                          Re: changed upload file size to larger but larger files are not uploading

                          Originally posted by navaldesign View Post
                          Each server has it's own setings as for max filesize that you can upload, and you can't override this limit this way. So you can change the limit in the script, but only up to the max limit allowed by the server.
                          Some VH servers are set to 12, some to 20, and last, some are set to 35 MB.

                          The only way to find that out and actually set the limit to a larger number, is by using the phpinfo() command (to gather the info) and using yet another script to create a local php.ini file. This is quite easily done with a small script, that reads the server php.ini file, it changes whatever needs to be changed, and it then saves a copy of it in your own folder. Here it is:

                          <!-- /* SCRIPT NAME: modify_php_ini.php */ -->
                          <?php
                          // Put all the php.ini parameters you want to change below. One per line.
                          // Follow the example format $parm[] = "parameter = value";

                          $parm[] = "upload_max_filesize = 50M";
                          // full unix path - location of the default php.ini file at your host
                          // you can determine the location of the default file using phpinfo()
                          $defaultPath = '/usr/local/lib/php.ini';
                          // full unix path - location where you want your custom php.ini file
                          //$customPath = "/path/php.ini";
                          $customPath = "php.ini";
                          // nothing should change below this line.
                          if (file_exists($defaultPath)) {
                          $contents = file_get_contents($defaultPath);
                          $contents .= "\n\n; MODIFIED THE FOLLOWING USER PARAMETERS:\n\n";
                          foreach ($parm as $value) $contents .= $value . " \n";
                          if (file_put_contents($customPath,$contents)) {
                          if (chmod($customPath,0600)) $message = "<b>PHP.INI File modified and copied.</b>";
                          else $message = "PROCESS ERROR - Failed to upadate php.ini.";
                          } else {
                          $message = "PROCESS ERROR - Failed to write php.ini file.";
                          }
                          } else {
                          $message = "PROCESS ERROR - php.ini file not found.";
                          }
                          echo $message;
                          ?>


                          Copy the above code, paste it in Notepad, save is as "modify_php_ini.php". Upload it on your server and run it (type in your browser "http://www.yourdomain.com/modify_php_ini.php")

                          It will modify the allowable file size to 50 Mb. If you need less, change it to 10, 20 or 30M, whatever you need.

                          It only affects your own site, not any other hosted on the same server.


                          In the script, it is assumed that your php.ini path is '/usr/local/lib/php.ini'

                          If you get from the script a message that php.ini was not found, use this other script:


                          <?php
                          phpinfo();
                          ?>

                          Upload it on your site as phpinfo.php and run it (http://www.yourdomain.com/phpinfo.php)

                          It will display all your server php settings, and among them, you will be able to see your php.ini path and your max upload file size




                          Tip: since a php.ini file locally saved is loaded each time a request takes place, if you only use it to override the file size issue, i suggest that you publish your form inside a dedicated folder, and also load this script and run it only for that folder. This way, when users visit your normal pages, in your public_html (or www, whatever it is named) folder, the local php.ini file is not loaded at all.

                          Hello Mr. Naval, I did copy the script and paste the above script as you instructed. The filesize I changes to 30MB. But I still have problem with those file that is larger than 8MB. I try 11MB and it doesn't work even I have change the php.ini setting from 15M to 30M. It show that it uploaded and it even display the thankyou_page too. Please help me to identify the problem. thank you.

                          Comment

                          • navaldesign
                            General & Forum Moderator

                            • Oct 2005
                            • 12080

                            #14
                            Re: changed upload file size to larger but larger files are not uploading

                            Because the max allowed post size is also 8 MB. So unless you make that also 30 (or 31...) MB you will not be able to upload such large files.

                            Please note that you are creating yourself, and consequently VH, a serious security issue. The contents of your "uploads" folder are clear to anyone. If a malicious guy uploads malicious code and then runs it, it cause cause serious problems.

                            For this reason, usually, the file names MUST be changed by adding a random prefix, AND the upload folder should be hidden. Or, at least, have a redirect rom that folder to your homepage, or have a blank index page in the folder that will prevent anyone from seeing the folder content.

                            Using ABVFP will prevent these problems. The script that you used here is very old, two or three yers ago, when security was not such an issue.
                            Navaldesign
                            Logger Lite: Low Cost, Customizable, multifeatured Login script
                            Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                            DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                            Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                            Comment

                            • wesleyvinhvan
                              Sergeant

                              • Mar 2008
                              • 21

                              #15
                              Re: changed upload file size to larger but larger files are not uploading

                              Mr Naval, thank you for your kind consultation on this matter. I will take your words to heart. I will also be looking into the NEW code from ABVFP. I hope that it is easy to use. By the way in ABVFP, do I still need to change the max post size ????

                              Comment

                              Working...
                              X