Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Upload Error 1

  1. #1
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Upload Error 1

    $uploaddir = '/home/jay/miguel/music/';
    $uploadfile = $uploaddir . basename($_FILES['mediaFile']['name']);
    if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
    echo "File is valid, and was successfully uploaded.\n";
    } else {
    echo "Possible file upload attack!\n";
    echo '<pre>';
    print_r ($_FILES);
    echo '</pre>';
    }

    Gets me the error
    Possible file upload attack!

    Array
    (
    [mediaFile] => Array
    (
    [name] => all 4 one - i can love you like that.mp3
    [type] =>
    [tmp_name] =>
    [error] => 1
    [size] => 0
    )

    )

    Funny that code looks real simple... I have write permissions to the directory. What's wrong?
    I'm gonna find a way to download the internet if its the last thing I do...
    Prepare to bow down to me (or my grave) and call me almighty when the algorithm is finished

  • #2
    New Coder
    Join Date
    Aug 2006
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts
    look a few threads down for my code

    exact same script as you are using

    al the best

  • #3
    New Coder
    Join Date
    Aug 2006
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts
    think this might be your problem

    if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile))

    a few lines up you have
    $_FILES['mediaFile']

    use 1 or the other


  •  

    Posting Permissions

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