video/image upload script?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • lost-angel
    Sergeant First Class

    • Mar 2006
    • 53

    video/image upload script?

    I have assigned the following values to my form:
    - Action: upload.php
    - Method: POST
    - EncodingType: multipart/form-data
    I have tried for the last 8 hours to use scripts from various threads and they all fail... I am sure that I am missing a critical step. Is there anyone who can walk me thru to the next step... the form is here: www.lost-angelz.com/submit.html I assume the next steps= create an upload folder in the public direct, create an upload.php page on the same public directory. what is the magical php script to make my form work?
    Lost-Angelz.com ****: http://www.lost-angelz.com/Lost-Angelz****off.html
  • navaldesign
    General & Forum Moderator

    • Oct 2005
    • 12080

    #2
    Re: video/image upload script?

    <?php

    // Receiving variables
    @$userfile_Name = $_FILES['userfile']['name'];
    @$userfile_Size = $_FILES['userfile']['size'];
    @$userfile_Temp = $_FILES['userfile']['tmp_name'];
    @$userfile_Mime_Type = $_FILES['userfile']['type'];
    @$Name = addslashes($_POST['Name']);
    @$E-mail = addslashes($_POST['E-mail']);
    @$comment = addslashes($_POST['comment']);
    function RecursiveMkdir($path)
    {
    if (!file_exists($path))
    {
    RecursiveMkdir(dirname($path));
    mkdir($path, 0777);
    }
    }
    if ($userfile_Size>0)
    {
    // Validation
    if( $userfile_Size == 0)
    {
    header("Location: errorpage.html");
    exit;
    }
    if( $userfile_Size >50000)
    {
    //delete file
    unlink($userfile_Temp);
    header("Location: errorpage.html");
    exit;
    }
    $uploadFile = "upload/".$userfile_Name ;
    if (!is_dir(dirname($uploadFile)))
    {
    @RecursiveMkdir(dirname($uploadFile));
    }
    else
    {
    @chmod(dirname($uploadFile), 0777);
    }
    @move_uploaded_file( $userfile_Temp , $uploadFile);
    chmod($uploadFile, 0644);
    $userfile_URL = "http://www.lost-angelz.com/upload/".$userfile_Name ;
    }

    //Sending Email to form owner
    $pfw_header = "From: $E-mail\n"
    . "Reply-To: $E-mail\n";
    $pfw_subject = "New File Upload";
    $pfw_email_to = "youremail@yourdomain.com";
    $pfw_message = "There is a new file uploaded.\n"
    . "-----------------------------------\n"
    . "File Link: $userfile_URL\n"
    . "Name: $Name\n"
    . "E-mail: $E-mail\n"
    . "Comment: $comment\n";
    *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
    header("Location: thankyoupage.html");
    ?>


    Create a folder in your public_html directory, call it "upload" and give it permissions 777.
    Copy the code, paste it in notepad, change youremail@yourdomain.com with the real email in your Vodahost account. If you wish the file size limit different than the 50000 bytes i have put in the script, just change it. Go to Save as, choose File Type: All files, and save it as "upload.php" Upload it in your public_html folder.

    Create two simple pages in BV, one called "errorpage" (for letting them know that the file is bigger than the allowed limit) and the second one "thankyoupage". Publish them. You are done.
    Please note that in the email you will have the file link, so just click on it to openit in your browser. If the file name has blank spaces, then the link will be broken, and you will need to copy the whiole link and paste it in your browser's address bar. If the file is of a type that can't be opened in your browser, just use Blue FTP to download it from your site to your computer and then open it using the appropriate software.
    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

    • lost-angel
      Sergeant First Class

      • Mar 2006
      • 53

      #3
      Re: video/image upload script?

      I copied and pasted the code listed below. I followed all instructions as far as creating folder and php page, thanx and error... I tested the form out, I did a test upload and it seemed to be working but instead of getting a thanks page or an error page i got this:

      Parse error: syntax error, unexpected '=' in /home/myusername/public_html/upload.php on line 9

      I replaced the correct directory path user name with "myusername" just to protect the account... below is the code I used, Did I mess up with an extra '=' or something?

      <?php
      // Receiving variables
      @$userfile_Name = $_FILES['userfile']['name'];
      @$userfile_Size = $_FILES['userfile']['size'];
      @$userfile_Temp = $_FILES['userfile']['tmp_name'];
      @$userfile_Mime_Type = $_FILES['userfile']['type'];
      @$Name = addslashes($_POST['Name']);
      @$E-mail = addslashes($_POST['E-mail']);
      @$comment = addslashes($_POST['comment']);
      function RecursiveMkdir($path)
      {
      if (!file_exists($path))
      {
      RecursiveMkdir(dirname($path));
      mkdir($path, 0777);
      }
      }
      if ($userfile_Size>0)
      {
      // Validation
      if( $userfile_Size == 0)
      {
      header("Location: errorpage.html");
      exit;
      }
      if( $userfile_Size >100000)
      {
      //delete file
      unlink($userfile_Temp);
      header("Location: errorpage.html");
      exit;
      }
      $uploadFile = "upload/".$userfile_Name ;
      if (!is_dir(dirname($uploadFile)))
      {
      @RecursiveMkdir(dirname($uploadFile));
      }
      else
      {
      @chmod(dirname($uploadFile), 0777);
      }
      @move_uploaded_file( $userfile_Temp , $uploadFile);
      chmod($uploadFile, 0644);
      $userfile_URL = "<A href="http://www.lost-angelz.com/upload/".$userfile_Name">http://www.lost-angelz.com/upload/".$userfile_Name ;
      }
      //Sending Email to form owner
      $pfw_header = "From: $E-mail\n"
      . "Reply-To: $E-mail\n";
      $pfw_subject = "New File Upload";
      $pfw_email_to = "mye-mail@lost-angelz.com";
      $pfw_message = "There is a new file uploaded.\n"
      . "-----------------------------------\n"
      . "File Link: $userfile_URL\n"
      . "Name: $Name\n"
      . "E-mail: $E-mail\n"
      . "Comment: $comment\n";
      *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
      header("Location: thankyoupage.html");
      ?>
      Last edited by navaldesign; 05-20-2006, 09:35 PM.
      Lost-Angelz.com ****: http://www.lost-angelz.com/Lost-Angelz****off.html

      Comment

      • navaldesign
        General & Forum Moderator

        • Oct 2005
        • 12080

        #4
        Re: video/image upload script?

        No, the problem seems to be (sorry i didn't see it before) the email field. Take the "-" off both your form and your script. Name the field "Email", and change accordingly all the necessary lines in the script, turning "E-mail" to "Email"
        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

        • lost-angel
          Sergeant First Class

          • Mar 2006
          • 53

          #5
          Re: video/image upload script?

          Navel Design, thanks... I finally got the Thankyou page after testing, so thanks.. funny how 1 little character can throw off the entire form process. EVERYTHING WORKS,thanx
          Lost-Angelz.com ****: http://www.lost-angelz.com/Lost-Angelz****off.html

          Comment

          • navaldesign
            General & Forum Moderator

            • Oct 2005
            • 12080

            #6
            Re: video/image upload script?

            You are welcome
            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

            • lost-angel
              Sergeant First Class

              • Mar 2006
              • 53

              #7
              Re: video/image upload script?

              umm, the script works but in the email I am missing the file link... I even went into the file manager via cpanel x to search... and the folder has no files even though the email says I have a new file upload... here is a copy and paste from the test upload:

              There is a new file uploaded.
              -----------------------------------
              File Link:
              Name: Daleon
              Email: scar_mega@lost-angelz.com
              Comment: my kicks
              Lost-Angelz.com ****: http://www.lost-angelz.com/Lost-Angelz****off.html

              Comment

              • navaldesign
                General & Forum Moderator

                • Oct 2005
                • 12080

                #8
                Re: video/image upload script?

                Sorry, one more mistake on my side. Change the $upload1_Size (blue colour) to $userfile_Size . Copying and pasting from my own scripts sometimes make me forget to correct the variable names. Sorry again.
                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

                • lost-angel
                  Sergeant First Class

                  • Mar 2006
                  • 53

                  #9
                  Re: video/image upload script?

                  Yep, that worked.... but ummm ran into another road block. I got this message when I clicked the link in the e-mail:


                  There is a new file uploaded.
                  -----------------------------------
                  File Link: http://www.lost-angelz.com/upload/airjordaniv.jpg
                  Name: Daleon
                  Email: scar_mega@lost-angelz.com
                  Comment: kicks


                  the above file link lead to this message:
                  Forbidden

                  You don't have permission to access /upload/airjordaniv.jpg on this server.

                  Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

                  also in cpanelx file manager:

                  Show File Contents <--- this actually opens the file that the link says is forbidden
                  Delete File
                  Edit File
                  Change Permissions
                  Rename File
                  Copy File
                  Move File

                  File Url: http://www.lost-angelz.com/upload/airjordaniv.jpg <-- leads to forbidden message
                  Lost-Angelz.com ****: http://www.lost-angelz.com/Lost-Angelz****off.html

                  Comment

                  • navaldesign
                    General & Forum Moderator

                    • Oct 2005
                    • 12080

                    #10
                    Re: video/image upload script?

                    Click on http://www.lost-angelz.com/upload then on airjordaniv.jpg I can see, and i can download the ***** pic, which means that the file permissions are ok. Check the permissions of your "upload" folder.
                    Last edited by navaldesign; 05-21-2006, 07:58 AM.
                    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

                    • lost-angel
                      Sergeant First Class

                      • Mar 2006
                      • 53

                      #11
                      Re: video/image upload script?

                      ok... that works, thanks
                      Lost-Angelz.com ****: http://www.lost-angelz.com/Lost-Angelz****off.html

                      Comment

                      • navaldesign
                        General & Forum Moderator

                        • Oct 2005
                        • 12080

                        #12
                        Re: video/image upload script?

                        So everything ok ?
                        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

                        • lost-angel
                          Sergeant First Class

                          • Mar 2006
                          • 53

                          #13
                          Re: video/image upload script?

                          It appears so... I have tested the new upload links... sometimes they connect.. sometimes they lead to the forbidden message so what i do when I get the forbidden message is break the link down to: http:lost-angelz.com/upload which takes me to a root directory for the upload folder.. i just click the relating upload file ... its a longer route to get the upload rather than just clicking the link in the e-mails but i can live with it... but like I said, sometimes the link in the e-mail actually opens the file but when i get the forbidden message I just break the link down to the root directory of the folder... So yes.. everything is good..thanks for the script
                          Lost-Angelz.com ****: http://www.lost-angelz.com/Lost-Angelz****off.html

                          Comment

                          • navaldesign
                            General & Forum Moderator

                            • Oct 2005
                            • 12080

                            #14
                            Re: video/image upload script?

                            You are welcome.
                            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

                            • zangoo
                              Private

                              • May 2006
                              • 2

                              #15
                              Re: video/image upload script?

                              I was trying out this upload script. Everytime I run it I only get the Thank You Page and an email with no infofor link, file etc. Any help will do.

                              Comment

                              Working...
                              X