Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image Uplaod Script Error

Status
Not open for further replies.

redzonne

Programmer
Feb 20, 2005
27
0
0
US
I get the following error:
Warning: copy(files/1094160166507_yaxay_468x60_1.gif): failed to open stream: Permission denied in /home/realest1/public_html/upload_7.php on line 12
Could not copy

Code:
<form name="form1" method="post" action="" enctype="multipart/form-data"> 
<input type="file" name="imagefile"> 

<input type="submit" name="Submit" value="Submit"> 
<? 
if(isset( $Submit )) 
{ 
//If the Submitbutton was pressed do: 

if ($_FILES['imagefile']['type'] == "image/gif")
        {
    copy ($_FILES['imagefile']['tmp_name'], "files/".$_FILES['imagefile']['name']) 
    or die ("Could not copy");
        echo ""; 
        echo "Name: ".$_FILES['imagefile']['name'].""; 
        echo "Size: ".$_FILES['imagefile']['size'].""; 
        echo "Type: ".$_FILES['imagefile']['type'].""; 
        echo "Copy Done...."; 
        }
else 
        { 
            echo ""; 
            echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['name'].")"; 
        } 
} 
?> </form>

An input on why?

The Journey of a Thousand Miles Begins with the First Step...
 
You don't have the correct filesystem permissions on the temp storage folder and/or the destination folder.

Bastien

I wish my computer would do what I want it to do,
instead of what I tell it to do...
 
Oh! Thanks.

The Journey of a Thousand Miles Begins with the First Step...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top