SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    error with file upload

    Hey all, when uploading a file.. im getting this error..
    PHP Code:
    WarningUnable to open 'C:\\My Documents\\button_roomrates.jpg' for readingNo such file or directory in /www/approvals/mackayllp/admin/add.php3 on line 37 
    just uploading an image from my comp.... the file is on my computer, and is in the exact same place its looking for it.. heres my upload code

    PHP Code:
    if ( "image/pjpeg" == $uploadedfile_type )
        {  
            
    $extension ".jpg";
        }
        else
        {  
            
    $extension ".gif";
        }

        
    $filename time() .  
    $REMOTE_HOST $extension;
    // Copy the file
    copy($picture$filename); 

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Where does $picture from this line get its value
    PHP Code:
    // Copy the file
    copy($picture$filename); 
    Shouldn't it be

    PHP Code:
    // Copy the file
    copy($uploadedfile$filename); 

    Also what does your form look like it does have

    PHP Code:
    enctype="multipart/form-data" 
    In the form tag right?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

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