Jump to content


Photo

Image upload problem


  • Please log in to reply
2 replies to this topic

#1 gerkintrigg

gerkintrigg
  • Members
  • PipPipPip
  • Magician
  • 828 posts
  • LocationBristol, UK
  • Age:37

Posted 25 May 2006 - 01:37 PM

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...
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']."'

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.
Neil Trigger - http://www.ghostlypublishing.co.uk - Ghostly Publishing - Children's Fantasy Books

#2 wisewood

wisewood
  • Members
  • PipPipPip
  • Advanced Member
  • 226 posts
  • LocationRotherham, England

Posted 25 May 2006 - 02:06 PM

Looks like you dont have the right permissions for the directory where you're saving the file.
wisewood: proven fact, I am both wise, and wooden.

#3 gerkintrigg

gerkintrigg
  • Members
  • PipPipPip
  • Magician
  • 828 posts
  • LocationBristol, UK
  • Age:37

Posted 25 May 2006 - 02:18 PM

Yeah, that's what i thought, but the permissions are set fine...
Perhaps my firewall settings?
Neil Trigger - http://www.ghostlypublishing.co.uk - Ghostly Publishing - Children's Fantasy Books




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users