Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2007
    Posts
    1,518
    Tokens
    75

    Latest Awards:

    Default [HELP] Upload Script

    i am doing the next vertion of slimupload.com
    and im a bit stuck on the upload script (its a realy simple one)

    it all works but when it uploads it comes up as this

    I would like to add the URL to the file the dir is /upload/

    this is the part of the code wich needs editing its come thing to do with echo because i dont know much about it would any one help please

    PHP Code:
    <?php
    //set where you want to store files
    //in this example we keep file in folder upload
    //$HTTP_POST_FILES['ufile']['name']; = upload file name
    //for example upload file name cartoon.gif . $path will be upload/cartoon.gif
    $path"upload/".$HTTP_POST_FILES['ufile']['name'];
    if(
    $ufile !=none)
    {
    if(
    copy($HTTP_POST_FILES['ufile']['tmp_name'], $path))
    {
    echo 
    "Successful<BR/>";
    //$HTTP_POST_FILES['ufile']['name'] = file name
    //$HTTP_POST_FILES['ufile']['size'] = file size
    //$HTTP_POST_FILES['ufile']['type'] = type of file
    echo "File Name :".$HTTP_POST_FILES['ufile']['name']."<BR/>";
    echo 
    "File Size :".$HTTP_POST_FILES['ufile']['size']."<BR/>";
    echo 
    "File Type :".$HTTP_POST_FILES['ufile']['type']."<BR/>";
    echo 
    "<img src=\"$path\" \">";
    }
    else
    {
    echo 
    "Error";
    }
    }
    ?>
    +Rep to all help

    Thanks


  2. #2
    Join Date
    Jul 2007
    Location
    Scotland
    Posts
    529
    Tokens
    0

    Default

    Unerneath the line that starts with
    PHP Code:
    echo "File Size:" 
    Add

    PHP Code:
    echo "File URL: http://www.slimupload.com/uploads/".$HTTP_POST_FILES['ufile']['name']."<BR/>"
    That should work

  3. #3
    Join Date
    Mar 2007
    Posts
    1,518
    Tokens
    75

    Latest Awards:

    Default

    :eusa_clap
    Quote Originally Posted by RichardKnox View Post
    Unerneath the line that starts with
    PHP Code:
    echo "File Size:" 
    Add

    PHP Code:
    echo "File URL: http://www.slimupload.com/uploads/".$HTTP_POST_FILES['ufile']['name']."<BR/>"
    That should work
    Thanks so much
    +Rep


  4. #4
    Join Date
    Feb 2008
    Location
    North Carolina, USA.
    Posts
    172
    Tokens
    0

    Default

    Register globals? Ew.

  5. #5
    Join Date
    Jul 2007
    Location
    Scotland
    Posts
    529
    Tokens
    0

    Default

    I agree with you on that Caleb

  6. #6
    Join Date
    Feb 2008
    Location
    North Carolina, USA.
    Posts
    172
    Tokens
    0

    Default

    Quote Originally Posted by RichardKnox View Post
    I agree with you on that Caleb
    Glad that it is gone forever in PHP6.

Posting Permissions

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