[SOLVED] Issues with File Permision

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
raymedia
Forum Commoner
Posts: 27
Joined: Thu Oct 09, 2003 6:36 am
Location: Melbourne, Australia

Issues with File Permision

Post 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;
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

[php_man]chmod[/php_man] it in your script after move_uploaded_file.
User avatar
raymedia
Forum Commoner
Posts: 27
Joined: Thu Oct 09, 2003 6:36 am
Location: Melbourne, Australia

Problem Solved

Post by raymedia »

thankx a lot for the quick help..really appriciate it...

everything is running smoothly.. :lol:
Post Reply