Likely this is a Windows issue, but I am posting under PHP just in case.
I'm trying to use PHP to upload files to the server. I'm developing, so the server and the client, are actually the same Win 7 x64 PC with IIS.
Once I upload the files using the following script they get locked in the target directory.
$attach_dir = $PATH_TO_ROOT . 'attachments/';
$client_dir = $attach_dir . 'client-' . $client_id;
//Check if client directory exists
copy($attach_dir . 'client-0/index.php', $client_dir . '/index.php'); //Security-purposes
//Check if Progress Directory exists
$progress_dir = $client_dir . '/prog-' . $progress_id;
copy($attach_dir . 'client-0/index.php', $progress_dir . '/index.php'); //Security-purposes
$temp_file = $_FILES['file']['tmp_name'][$file_no];
$file = str_replace(' ', '_', $file);
$dest = $progress_dir . '/' . $file;
By locked, I mean that I get access denied both when using <a href=".../myfile.txt">and by trying to opening through the File Explorer. The only way to unlock them is by going into Safe Mode as explained here
I dont think this is my code, but rather my settings in Windows, but I have posted this under both topics. I am also thinking that the IIS_IUSRS is probably doing upload and maybe that is locking it, but it does have full permissions to the root directory.
Any help will be greatly appreciated.