need : free PHP Upload script

Discussion in 'PHP' started by psytech, Sep 3, 2008.

  1. #1
    Hi,
    I'm searching for a free & easy to use PHP uploading script that allow visitors of my site to upload files to my server and and then to inform me that new files are uploaded.
    To be more specific - my idea is to make easier the way my visitor to send me files and not to be public shown. Something like yousendit service but I'm the only one recipient.

    Any ideas ?

    Thanks in advance for Your help!
     
    psytech, Sep 3, 2008 IP
  2. Sleeping Troll

    Sleeping Troll Peon

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Php has built in function for this,

    $_FILES['UploadFile']['tmp_name'];

    PM if you need more assistance.
     
    Sleeping Troll, Sep 3, 2008 IP
  3. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #3
    You need a contact form with file upload option.

    Peace,
     
    Barti1987, Sep 3, 2008 IP
  4. gustavorg

    gustavorg Active Member

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    61
    #4
    Please let me know if you still need help with this.
     
    gustavorg, Sep 3, 2008 IP
  5. psytech

    psytech Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yes , i'm still opened for more suggestions.
    Thanks to Sleeping Troll !

    @azizny : contact form with attachment is good , but i need the files on my server , not at my email. I'm thinking about image files for example 3-5mb each and to be possible to get multiple files with just one post.

    Let me explain more - I'm working with graphics and in this way will let my client to submit me pictures directly. And for example some of the packages may be around 50 - 100mb
     
    psytech, Sep 4, 2008 IP
  6. Abid Anwar

    Abid Anwar Peon

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    <form enctype="multipart/form-data" action="upload.php" method="POST">
    Please choose a file: <input name="uploaded" type="file" /><br />
    <input type="submit" value="Upload" />
    </form>

    This form sends data to the file "upload.php", which is what we will be creating next to actually upload the file.
     
    Abid Anwar, Sep 5, 2008 IP
  7. Abid Anwar

    Abid Anwar Peon

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    i m sending you the code this should help you....it uploads the file to the desire location and gives you the server reply about the uploaded file that it is correctly uploaded or not.......hope it helps you..regards..

    <?php header('Content-type: application/vnd.wap.xhtml+xml'); ?>
    <?php echo '<?xml version="1.0"?' . '>'; ?>
    <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

    <html xmlns="http://estudents.co.cc/1999/xhtml">
    <head>
    <title>File Upload Example</title>
    </head>

    <body>
    <h1>Data Received at the Server</h1>
    <hr/>
    <p>

    <?php
    foreach ($_POST as $key => $value){
    ?>

    <b>Name-value Pair Info:</b><br/>
    Field name: <?php echo $key; ?><br/>
    Field value: <?php echo $value; ?><br/><br/>

    <?php
    }

    $optionalFileName = $_POST['filename'];

    if ($_FILES['myFile']['error'] == UPLOAD_ERR_OK){
    $fileName = $_FILES['myFile']['name'];
    ?>

    <b>Uploaded File Info:</b><br/>
    Content type: <?php echo $_FILES['myFile']['type']; ?><br/>
    Field name: myFile<br/>
    File name: <?php echo $fileName; ?><br/>
    File size: <?php echo $_FILES['myFile']['size']; ?><br/><br/>

    <?php
    /* Save the uploaded file if its size is greater than 0. */
    if ($_FILES['myFile']['size'] > 0){
    if ($optionalFileName == "")
    $fileName = basename($fileName);
    else
    $fileName = $optionalFileName;

    $dirName = '/file_uploads/';

    if (move_uploaded_file($_FILES['myFile']['tmp_name'], $dirName . $fileName)){
    ?>

    <b>The uploaded file has been saved successfully.</b>

    <?php
    }
    else{
    ?>

    <b>An error occurred when we tried to save the uploaded file.</b>

    <?php
    }
    }
    }
    ?>

    </p>
    </body>
    </html>
     
    Abid Anwar, Sep 5, 2008 IP
  8. theivo

    theivo Well-Known Member

    Messages:
    238
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #8
    Thanks a million , Abid Anwar !
     
    theivo, Sep 5, 2008 IP
  9. psytech

    psytech Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks and from me , maybe i found my answer in Abid Anwar's post !
     
    psytech, Sep 5, 2008 IP