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! Quote Link to comment 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 Quote Link to comment 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!!! Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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'; Quote Link to comment 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'; Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.