Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

153 users online



upload img to image folder

upload img to image folder

Currently viewing this thread: 1 (0 members and 1 guests)


james182

james182

Neverside Newbie
Status: Offline!

upload img to image folder

Warning: move_uploaded_file(../images/photos/melb03.jpg): failed to open stream: Permission denied in /home/virtual/site341/fst/var/www/html/mattlauder.com/admin/upload.php on line 29

Warning: move_uploaded_file(): Unable to move '/tmp/phpyNa6ss' to '../images/photos/melb03.jpg' in /home/virtual/site341/fst/var/www/html/mattlauder.com/admin/upload.php on line 29

This is my error i get when i upload an image on media temple server, but on localhost i get no error.

my code

PHP:

<? 
//initilize PHP

if($_POST['submit']) //If submit is hit
{
   include (
'connect.php');

   
//convert all the posts to variables:
   
$date $_POST['date'];
   
$title $_POST['title'];
   
$location $_POST['location'];
   
$code $_POST['code'];
   
$category $_POST['category'];
      
$uploaddir '../images/photos/';
$uploadfile $uploaddir basename($_FILES['userfile']['name']);
$uploadfilename basename($_FILES['userfile']['name']);

if (
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
   echo 
"<span class='content'>Added successfully.</span><br>";
} else {
   echo 
"<span class='content'>Sorry not uploaded\n</span>";
}
}
$result=MYSQL_QUERY("INSERT INTO photos (id,date,title,image,location,code,category)".
      
"VALUES ('NULL', '$date', '$title', '$uploadfilename', '$location', '$code', '$category')"); 
?>

tcbil

tcbil

I hate Customer Services!
Status: Offline!

hello, I am afraid I can't really help with your problem, however I am interested in the entire system has i require something similar, could you post the other pages that are associated please? thanks

___________________

PHP Freak Wannabe!

TylerDurden

TylerDurden

Cheeky!
Status: Offline!

maybe if you set permissions on the 'photos' directory to 777, that is all permissions, to read, write and execute/search, for all groups. You can to this on your FTP maybe or in a filemanager on your server. I think you can also do it with PHP with the chmod() function.

___________________

http://www.xs4all.nl/~wiewer/sam_pixelart.jpg

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0071 seconds.