Jump to content

[SOLVED] Uploading file, moving file Permission error


suttercain

Recommended Posts

Is this something to do with the host?

Warning: move_uploaded_file(../images/articles/phpGsDtno): failed to open stream: Permission denied in

 

 

//IF THERE IS A FIRST PICTURE
if ($_FILES['articlePicOne']) {
$imageName = $gathered['articleId'];
// PROCESS IMAGE
$target_path = "../images/articles/";
$target_path = $target_path . basename( $_FILES['articlePicOne']['tmp_name']); 
$_FILES['articlePicOne']['tmp_name'];

//MOVE THE IMAGE TO THUMBNAILS
move_uploaded_file($_FILES['articlePicOne']['tmp_name'], $target_path);

//EXPLODE TO RENAME IMAGE
$fileName = $_FILES['articlePicOne']['name'];
$broken = explode(".", $fileName);
rename("../images/articles/".basename($_FILES['articlePicOne']['tmp_name'])."", "../images/articles/".$imageName."_01." .$broken[1]."");

$update = mysql_query("UPDATE articles SET articlePicOne='" .$imageName."." .$broken[1]. "' WHERE articleId='".$imageName."'"		) or die(mysql_error());

if ($update) {
echo "It worked!?";
}

}

 

 

Archived

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

×
×
  • Create New...

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.