Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to upload files in upload folder using php on localhost due to restriction on permission change imposed by Windows 7
    primarykey
    data
    text
    <p>I am doing File upload using PHP, files are unable to get uploaded because the folder is set to read-only. I have installed <strong>XAMPP</strong> and in my <em>htdocs</em> folder there is a folder whom i want to make my upload folder. </p> <p>After searching from a long time, i finally came up to Microsoft Support Forum, it said that we cannot change folder permission.</p> <p>Check this out @ Microsoft <a href="http://support.microsoft.com/kb/326549" rel="nofollow">http://support.microsoft.com/kb/326549</a></p> <p>Still if anyone have any solution to it...</p> <p>I tried <code>chmod("upload/", 0777);</code> for upload folder before file uploading process, still its not working...</p> <p>I am adding my script also, so that you people can find a pass through for me.</p> <pre><code>$exten = explode( "." , $_FILES['complaint_file']['name']); $exten = $exten[1]; if ( ($exten == "jpg") || ($exten == "JPG") || ($exten == "jpeg") || ($exten == "JPEG") || ($exten == "png") || ($exten == "PNG") || ($exten == "gif") || ($exten == "GIF") ) { chmod("upload/", 0777); if(@move_uploaded_file($_FILES['complaint_file']['temp_name'], "upload/".time().".".$exten)) { $filename = time().".".$exten; $insertSQL = sprintf("UPDATE complaints SET complaint_status='CLOSED', complaint_solved_date=NOW(), complaint_remark=%s complaint_filename=%s WHERE complaint_number=%s", GetSQLValueString($_POST['complaint_remark'], "text"), GetSQLValueString($_POST['confirm_close_complaint'], "text"), GetSQLValueString($filename, "text")); $Result1 = mysql_query($insertSQL, $dacreint) or die(mysql_error()); header('Location: complaint-register.php?ComplaintClose=Successful'); exit(); } else { header('Location: complaint-register.php?FileUploadError=1'); exit(); } } else { header('Location: complaint-register.php?ExtensionError=1'); exit(); } </code></pre> <p>When i do file upload it skips the if condition and runs the following piece of code from top:-</p> <pre><code>else { header('Location: complaint-register.php?FileUploadError=1'); exit(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload