failed to open stream: Permission denied
Posted: Mon Mar 05, 2007 6:00 am
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
Im trying to upload a document file in to a remote server. But im getting the following error. I tried changing the permission for the folder also.
It works fine when i tried in the local machine. What may be the problem
Warning: move_uploaded_file(/home/smartchu/public_html/website_content/test1_595446942/test.doc): failed to open stream: Permission denied in /home/smartchu/public_html/upload_test.php on line 26
Warning: move_uploaded_file(): Unable to move '/tmp/php23ki2U' to '/home/smartchu/public_html/website_content/test1_595446942/test.doc' in /home/smartchu/public_html/upload_test.php on line 26Code: Select all
$id=$nam."_".rand();
$uploaddir="/home/smartchu/public_html/website_content/".$id."/";
$name1 = $_FILES["userfile1"]["name"];
$destination1 = $uploaddir.$name1;
$destination1 = "/home/smartchu/public_html/website_content/".$name1;
move_uploaded_file($_FILES['userfile1']['tmp_name'], $destination1);//line #26feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]