datoshway Posted May 18, 2010 Share Posted May 18, 2010 This is my upload script and I just switched servers and their server is defaulting to 600, need some help on how to integrate a chmod into this. <?php $arrDataExtra = array("dtEntered" => date(STR_SQL_DATE_FORMAT)); $arrDataArray = array("strName" => "", "txtDetails" => ""); prepVariables($_POST); $arrDataArray = buildDataArray($arrDataArray); $strQuery = db_auto_query(INT_QUERY_INSERT, "tblNews", $arrDataArray, array(), $arrDataExtra, false); db_query($strQuery); $intContentID = db_insert_id(); if ($intContentID > -1) { $strProductPath = STR_UPLOADS_PATH . $intContentID . "/"; if (!file_exists($strProductPath)) { @mkdir($strProductPath); @mkdir($strProductPath . "_thumbs/"); } // upload image if (($_FILES['filImage']['error'] == UPLOAD_ERR_OK) && ($_FILES['filImage']['error'] != UPLOAD_ERR_NO_FILE)) { $arrPathInfo = pathinfo($_FILES['filImage']['name']); $strFilename = uniqid(rand(), true) . "." . strtolower($arrPathInfo['extension']); move_uploaded_file($_FILES['filImage']['tmp_name'], $strProductPath . $strFilename); // thumb resizePhoto(88, $strProductPath . $strFilename); // update record $strQuery = sprintf( "UPDATE tblNews SET strFilename = '%s' WHERE intID = %d", addslashes($strFilename), intval($intContentID)); db_query($strQuery); } $strSuccess = "Successfully added that news!"; } else { $strProblem = "There was a problem encountered while trying to add that news. Please try again."; } ?> Link to comment https://forums.phpfreaks.com/topic/202193-image-upload-chmod-help/ Share on other sites More sharing options...
datoshway Posted May 18, 2010 Author Share Posted May 18, 2010 Got it, just added chmod("$strProductPath".$strFilename, 0750); Link to comment https://forums.phpfreaks.com/topic/202193-image-upload-chmod-help/#findComment-1060262 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.