Jump to content

Archived

This topic is now archived and is closed to further replies.

gerkintrigg

Image upload problem

Recommended Posts

Hi I'm having a problem with my image upload script...
It's showing an error:
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Warning: copy(../../../../shop/uploaded_images/m2kencode23.gif): failed to open stream: Permission denied in /hsphere/local/home/davetrig/magic2k.com/admin/shop/edit/item/got_image.php on line 95
Could not copy, please use the back button to try again.[/quote]

This is my code...
[code]if ((in_array($_FILES['imagefile']['type'], $image_types)) &&
($_FILES['imagefile']['size'] < 600000)) {

copy ($_FILES['imagefile']['tmp_name'], $root."shop/uploaded_images/".$_FILES['imagefile']['name'])
    or die ("Could not copy, please use the back button to try again.");
    $_SESSION['imgurl']='shop/uploaded_images/'.$_FILES['imagefile']['name'];
    echo "<BR><BR>Thank you, the following image was uploaded:<BR><BR><img src='".$root.$_SESSION['imgurl']."' [/code]

That's some of it anyway... I think that the error's in there somewhere (if it is a script error)...

Can anyone advise?

Thanks.

Share this post


Link to post
Share on other sites
Looks like you dont have the right permissions for the directory where you're saving the file.

Share this post


Link to post
Share on other sites
Yeah, that's what i thought, but the permissions are set fine...
Perhaps my firewall settings?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.