Page 1 of 1

Issues with File Permision

Posted: Fri Jun 11, 2004 10:45 am
by raymedia
Hi guys...this is a bit of my code..to process uploads. everything works good..except..for some reason..the file lock the permission.. i cannot access it through ftp...even when i tried to change the chmod to 777..it give me "Permission Denied" error... the site is hosted by unix server..

so if anyone have any idea..or experienced this before..please help me..thanx guys..

Code: Select all

function updateImage($HTTP_POST_FILES, $originalImage){
		$uploaddir = '../My Documents/My Pictures/images/brandsImage/';
		if (isset($_FILES&#1111;'file']) and $_FILES&#1111;'file']&#1111;'name'] <> "")&#123;
			$uploadfile = $uploaddir . $_FILES&#1111;'file']&#1111;'name'];
			if (move_uploaded_file($_FILES&#1111;'file']&#1111;'tmp_name'], $uploadfile)) &#123;
			   echo "File is valid, and was successfully uploaded. ";

			   if ($originalImage <> "" and file_exists($uploaddir . $originalImage))&#123;
					unlink($uploaddir . $originalImage);
			   &#125;
			&#125; else &#123;
			   echo "Invalid file type";
			&#125;
		&#125; else &#123;
			echo "No image supplied";
		&#125;
	&#125;

Posted: Fri Jun 11, 2004 11:11 am
by Weirdan
[php_man]chmod[/php_man] it in your script after move_uploaded_file.

Problem Solved

Posted: Fri Jun 11, 2004 12:20 pm
by raymedia
thankx a lot for the quick help..really appriciate it...

everything is running smoothly.. :lol: