Results 1 to 24 of 24

Thread: video/image upload script?
      
   

  1. #1
    Join Date
    Mar 2006
    Posts
    53

    Cool 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?

  2. #2
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default 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!


  3. #3
    Join Date
    Mar 2006
    Posts
    53

    Default 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 at 09:35 PM.

  4. #4
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default 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!


  5. #5
    Join Date
    Mar 2006
    Posts
    53

    Default 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

  6. #6
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default 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!


  7. #7
    Join Date
    Mar 2006
    Posts
    53

    Default 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

  8. #8
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default 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!


  9. #9
    Join Date
    Mar 2006
    Posts
    53

    Default 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

  10. #10
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default 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 at 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!


  11. #11
    Join Date
    Mar 2006
    Posts
    53

    Default Re: video/image upload script?

    ok... that works, thanks

  12. #12
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default 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!


  13. #13
    Join Date
    Mar 2006
    Posts
    53

    Default 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

  14. #14
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default 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!


  15. #15
    Join Date
    May 2006
    Posts
    2

    Default 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.

  16. #16
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: video/image upload script?

    Quote Originally Posted by zangoo
    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.
    Please upload your php script.
    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!


  17. #17
    Join Date
    Jun 2006
    Posts
    26

    Default Re: video/image upload script?

    i used above mentioned instruction and adjusted it for my needs. everything works great except last line "comment". i dont know where is the problem, there is no comment text in email. My form: http://www.bannerclickmania.com/form1.php



    <?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']);
    @$Email = addslashes($_POST['Email']);
    @$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 >5000000)
    {
    //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.bannerclickmania.com/upload/".$userfile_Name ;
    }

    //Sending Email to form owner
    $pfw_header = "From: $Email\n"
    . "Reply-To: $Email\n";
    $pfw_subject = "New File Upload";
    $pfw_email_to = "addbanner@bannerclickmania.com";
    $pfw_message = "There is a new file uploaded.\n"
    . "-----------------------------------\n"
    . "File Link: $userfile_URL\n"
    . "Name: $name\n"
    . "Email: $Email\n"
    . "Webpage: $webpage\n"
    . "Numbercell: $numbercell\n"
    . "Micetext: $micetext\n"
    . "Password: $password\n"
    . "Comment: $comment\n";
    *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
    header("Location: thankyoupage.html");
    ?>

  18. #18
    Join Date
    Jun 2006
    Posts
    26

    Default Re: video/image upload script?

    I forgot to ask. How to add my option butons to the code?

  19. #19
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: video/image upload script?

    The two radio buttons should belong to the same group. I don't know why you don't receive the comment textarea content. It looks 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!


  20. #20
    Join Date
    Mar 2005
    Location
    Wilmington, Delaware USA
    Posts
    12,313

    Default Re: video/image upload script?


    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    02036089024 / United Kingdom
    291916438 / Australia

    ------------------------

    Top 3 Best Sellers

    Web Hosting - Unlimited disk space & bandwidth.

    Reseller Hosting - Start your own web hosting business.

    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)



  21. #21
    Join Date
    Mar 2006
    Posts
    53

    Default Re: video/image upload script?

    Was getting alot of test submissions... blank forms sumitted. This webpage (video upload) has been removed from http://www.lost-angelz.com and replaced with a standard contact form, The script supplied by naval design does work. Page was removed from website only because uploading files was no longer needed. If you do use the script you may want to ad a validator code string to stop blank submissions.

  22. #22
    Join Date
    Jul 2007
    Posts
    3

    Smile Re: video/image upload script?

    Quote Originally Posted by navaldesign View Post
    <?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.
    Hi Dude,

    i am working on a very big project and i need this functionality.
    User should be able to upload videos in the site. I need the complete code for the form as well as script.
    can you please do this favour for me

    Thanks
    Ramesh

  23. #23
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: video/image upload script?

    Creating he code for the form as wel as the script goes beyond this forum limits. However, i suggest that you create your form in BV, and then download and install Advanced BlueVoda Form Processor which will take care of the submission part and will also deliver the files on your desktop as attached files in your 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!


  24. #24
    Join Date
    Jul 2007
    Posts
    3

    Default Re: video/image upload script?

    thnx a lot dude. will try the way you suggested and will ping you when if i fall into problem.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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