i am uploading an image on live linux hosting server and getting the below error
Warning: move_uploaded_file(../graphics/home_bigad2.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/gads/public_html/vineet/admin/add_special_offer.php on line 12
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpXjKkp7' to '../graphics/home_bigad2.jpg' in /home/gads/public_html/vineet/admin/add_special_offer.php on line 12
This is my php code
move_uploaded_file($_FILES['offer_image']['tmp_name'], "../graphics/" . $_FILES['offer_image']['name']);
$qry="insert into special_offers(location,offer_image) values('$loc', '$path')";
$msg="Offer Inserted successfully";
$msg="Error Inserting Offer";
Make sure the folder you’re moving to file to has the correct permissions.
how do i set corect permission. can u say in detail
Do you use an FTP for your site files – if so, what FTP program, or are they stored locally on your computer?
If they’re stored on your computer, you can right-click a folder or file, select properties, and then, from the security tab, change it’s permissions. – This is for Windows.
My FTP allows me to do the same thing; right-click the folder/file I want to edit, then change the permissions from their.
i m using ftp software.
tell me what to write in permission after right click properties. at present its 755
Try changing it to 766.
just a question in my mind that
will changing permission harm my server or website security in any way.