pttdt Posted December 3, 2010 Share Posted December 3, 2010 I am looking for the code|script to put on my update.php that allows uploaded images to be saved in my database (chmod) 777? PLEASE HELP! Link to comment https://forums.phpfreaks.com/topic/220567-codescript-to-save-images-chmod-to-777/ Share on other sites More sharing options...
litebearer Posted December 3, 2010 Share Posted December 3, 2010 have you attemped any coding thus far? show us what you have tried Link to comment https://forums.phpfreaks.com/topic/220567-codescript-to-save-images-chmod-to-777/#findComment-1142611 Share on other sites More sharing options...
pttdt Posted December 3, 2010 Author Share Posted December 3, 2010 My php experience is limited. I purchased an event calendar and the developers are having problems with this bug. I am taking it upon myself to try to find an answer because this is critical to my website. I wish I could be more helpful and I APPRECIATE any help!!! Link to comment https://forums.phpfreaks.com/topic/220567-codescript-to-save-images-chmod-to-777/#findComment-1142616 Share on other sites More sharing options...
Pikachu2000 Posted December 3, 2010 Share Posted December 3, 2010 have you attemped any coding thus far? show us what you have tried Link to comment https://forums.phpfreaks.com/topic/220567-codescript-to-save-images-chmod-to-777/#findComment-1142628 Share on other sites More sharing options...
sweeb Posted December 3, 2010 Share Posted December 3, 2010 All you have to do is add the line chmod($filePath, 777); $filePath being the final path of your file after it has been uploaded. Link to comment https://forums.phpfreaks.com/topic/220567-codescript-to-save-images-chmod-to-777/#findComment-1142746 Share on other sites More sharing options...
pttdt Posted December 4, 2010 Author Share Posted December 4, 2010 Thats great a solution!!! Where do I put this? $temp_name = $_FILES['Filedata']['tmp_name']; $file_name = basename($_FILES['Filedata']['name']); $file_name = str_replace("\\","",$file_name); $file_name = str_replace("'","",$file_name); $file_path = $upload_dir.$file_name; $result = move_uploaded_file($temp_name, $file_path); }else{ if(!backUpFiles(file_get_contents('../events.xml'), '.')){ echo BACKUP_ERROR ; exit; } $filename = '../events.xml'; Link to comment https://forums.phpfreaks.com/topic/220567-codescript-to-save-images-chmod-to-777/#findComment-1142774 Share on other sites More sharing options...
sweeb Posted December 4, 2010 Share Posted December 4, 2010 $temp_name = $_FILES['Filedata']['tmp_name']; $file_name = basename($_FILES['Filedata']['name']); $file_name = str_replace("\\","",$file_name); $file_name = str_replace("'","",$file_name); $file_path = $upload_dir.$file_name; $result = move_uploaded_file($temp_name, $file_path); chmod($file_path, 777); }else{ if(!backUpFiles(file_get_contents('../events.xml'), '.')){ echo BACKUP_ERROR ; exit; } $filename = '../events.xml'; Link to comment https://forums.phpfreaks.com/topic/220567-codescript-to-save-images-chmod-to-777/#findComment-1142780 Share on other sites More sharing options...
pttdt Posted December 4, 2010 Author Share Posted December 4, 2010 Unfortunately this didn't work! Image was saved as 411. Link to comment https://forums.phpfreaks.com/topic/220567-codescript-to-save-images-chmod-to-777/#findComment-1142786 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.