Results 1 to 6 of 6

Thread: upload problem
      
   

  1. #1
    GoldDraco13's Avatar
    GoldDraco13 is offline Sergeant Major
    Join Date
    Jun 2005
    Location
    Alberta, Canada
    Posts
    92

    Question upload problem

    I made a form and had it working without error's till I added a upload option and tried to set up my action.php to work with it.


    My Web Site Form Address
    http://www.prairiefireservices.com/installation.html


    My Error when I submit form with upload selected
    Code:
    ?> 
    Warning: chmod() [function.chmod]: No such file or directory in /home/dragons/public_html/prairiefireservices/uploadaction.php on line 53
     
    Warning: Cannot modify header information - headers already sent by (output started at /home/dragons/public_html/prairiefireservices/uploadaction.php:9) in /home/dragons/public_html/prairiefireservices/uploadaction.php on line 74
    ?>

    My uploadaction.php
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Thank You</title>
    <meta name="AUTHOR" content="GoldDraco13">
    <meta name="KEYWORDS" content="fireplace, gas, wood, service, install, house, build">
    <meta http-equiv="Page-Enter" content="blendTrans(Duration=1)">
    <meta name="GENERATOR" content="Created by BlueVoda">
    <style type="text/css">
    div#container
    {
       width: 800px;
       position: relative;
       margin-top: 0px;
       margin-left: auto;
       margin-right: auto;
       text-align: left;
    }
    body
    {
       text-align: center;
       margin: 0;
    }
    </style>
    ?> 
    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    <?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 >100000000)
    {
    //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 = "<A href="http://www.dragonsofpern3.com/uploads/".$upload_Name">http://www.dragonsofpern3.com/uploads/".$upload_Name ;
    }
    //Sending Email to form owner
    $mailto = "dragons@dragonsofpern3.com";
    $mailsubj = "PF Install Form";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Job Specs :\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: thankyou_page.html");
    ?>
    ?> 
    <div id="container">
    <div id="bv_" style="position:absolute;left:0px;top:97px;width:800px;height:6px;z-index:0" align="left">
    <img src="bv01019.gif" id="Shape1" align="top" alt="" border="0" width="800" height="6"></div>
    <div id="bv_" style="position:absolute;left:6px;top:6px;width:790px;height:76px;z-index:1" align="center">
    <font style="font-size:32px" color="#8B0000" face="Georgia"><b><i>Prairie Fire Services<br>
    Conformation</i></b></font></div>
    <img src="PF_logo.JPG" id="Image1" alt="" align="top" border="0" width="51" height="85" style="position:absolute;left:6px;top:6px;width:51px;height:85px;z-index:2">
    <img src="PF_logo.JPG" id="Image2" alt="" align="top" border="0" width="51" height="85" style="position:absolute;left:743px;top:6px;width:51px;height:85px;z-index:3">
    <div id="bv_" style="position:absolute;left:0px;top:208px;width:794px;height:280px;z-index:4" align="center">
    <font style="font-size:48px" color="#8B0000" face="Georgia"><b><i>Thank you<br>
    for choosing<br>
    Prairie Fire Services<br>
    for your<br>
    fireplace needs</i></b></font></div>
    <a href="http://www.prairiefireservices.com" target="_self"><img src="home.bmp" id="Image3" alt="" align="top" border="2" width="44" height="41" style="position:absolute;left:376px;top:524px;width:48px;height:45px;z-index:5"></a>
    </div>
    </body>
    </html>

    Thanks for any help to resolve this issue.


    GD13,
    =]

  2. #2
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default Re: upload problem

    GD13-

    This is supposed to go into notepad- not into a webpage.

    Second- i have changed the code and the "Upload Url " Line was in error.

    Also-- you have not created an error.html page to go with this script.

    PHP Code:
    <?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 >100000000)
    {
    //delete file
    unlink($upload_Temp);
    header("Location: error.html");
    exit;
    }
    $uploadFile "uploads/".$upload_Name ;
    @
    move_uploaded_file$upload_Temp $uploadFile);
    chmod($uploadFile0644);
    $upload_URL "http://www.dragonsofpern3.com/uploads/".$upload_Name;
    }
    //Sending Email to form owner
    $mailto "dragons@dragonsofpern3.com";
    $mailsubj "PF Install Form";
    $mailhead "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody "Job Specs :\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: thankyou_page.html");
    ?>
    First- go back and read through the tutorial and see if you covered everything. Make the changes and then test.

    Andy
    PHP- is a blast!

  3. #3
    GoldDraco13's Avatar
    GoldDraco13 is offline Sergeant Major
    Join Date
    Jun 2005
    Location
    Alberta, Canada
    Posts
    92

    Default Re: upload problem

    I went and made a seperate uploadaction.php on a notepad and uploaded it to the site, I also made a thankyou_page and error_page and made a folder in my main directory "uploads", I directed the form to the uploadaction.php and I'm still getting the same errors.

    uploadaction.php
    Code:
    <?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 >100000000)
    {
    //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 = "<A href="http://www.dragonsofpern3.com/uploads/".$upload_Name">http://www.dragonsofpern3.com/uploads/".$upload_Name;
    }
    //Sending Email to form owner
    $mailto = "dragons@dragonsofpern3.com";
    $mailsubj = "PF Install Form";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Job Specs :\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: thankyou_page.html");
    ?>
    Error Message

    Warning: chmod() [function.chmod]: No such file or directory in /home/dragons/public_html/prairiefireservices/uploadaction.php on line 20

    Warning: Cannot modify header information - headers already sent by (output started at /home/dragons/public_html/prairiefireservices/uploadaction.php:20) in /home/dragons/public_html/prairiefireservices/uploadaction.php on line 38


    Form Address

    http://www.prairiefireservices.com/installation.html


    Questions:

    1. Do you upload the error and thankyou page to the same directory as the uploadaction.php ? I only ask cause it seems the error is saying it can't find them.

    2. I'm working this form from a sub domain name so its in a sub folder of the main folder, would the uploadaction.php in a sub folder be effected? Just asking to see if my situation is making this more difficult.

    Thanks for any help given, I've loved this service since day 1 and even with the few problems I get I'm happy to have found BV.


    GD13,

  4. #4
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default Re: upload problem

    Yes- all the files must be in the same directory. Give that a try.

    Your form does submit if no fields are filled in- so at least the form is submitting to the uploadaction.php


    Andy
    PHP- is a blast!

  5. #5
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Default Re: upload problem

    1st: you can't upload a 100 Mb file using a php script. Even changing the .ini file setings by using a local php.ini file, you can get up to 52 Mb.

    2nd, why don't you simply install ABVFP? It will handle easily all your uploads and will also email you the files.

    3rd: create a folder called "uploads" in the same folder where the script is, and change its permissions to 777 before trying the script.

    4th: you have no link in your email body that will let you know that a file has been uploaded, nor the link to the file itself. You will have to check, everytime you recieve a submission, to see if a new file has been uploaded. Not very easy when you have 30 - 50 or more files in your "uploads" folder.
    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!


  6. #6
    GoldDraco13's Avatar
    GoldDraco13 is offline Sergeant Major
    Join Date
    Jun 2005
    Location
    Alberta, Canada
    Posts
    92

    Default Re: upload problem

    Thanks alot for all your help, all the advice has been extremly helpful, I have it working and am on my way to a get working web site. www.prairiefireservices.com check it out, let me know what you think.


    GD13,
    =]

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49