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 2 of 2
  1. #1
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts

    Simple upload not working

    I've used this same coding on another website and it worked perfectly. However it won't work on another.

    FORM
    PHP Code:
    $page .= '<form enctype="multipart/form-data" action="alliance.php?do=banner" method="POST">';
            
    $page .= '<input type="hidden" name="MAX_FILE_SIZE" value="1500000">
    <input type="hidden" name="completed" value="1">'
    ;
            
    $page .= '<p><b>Banner Image:</b> <input type="file" name="mailfile" size="chars"><br /><br /><input type="submit" name="submit" value="Make Changes"></form>'
    POST SUBMIT
    PHP Code:
    //Start image upload
     
    $newname uniqid("a").".jpg";
     
    move_uploaded_file($_FILES['mailfile']['tmp_name'],"/aimages/$newname");
    //End of request image 
    The directory aimages is CHMOD to 777.

    I get the following errors.
    Warning: move_uploaded_file(/aimages/a4b6486f401249.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/rodgameo/public_html/alliance.php on line 3345

    Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/var/tmp/phprYUEiY' to '/aimages/a4b6486f401249.jpg' in /home/rodgameo/public_html/alliance.php on line 3345
    Last edited by masterofollies; 01-30-2010 at 08:26 PM.
    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?

  • #2
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    I should have played with it more, found out it was just a path error.
    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?


  •  

    Posting Permissions

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