- Code: Select all
passthru("whoami");
$tims_path = "localhost/DispatchReports/DispatchReportsFolder";
if ( !file_exists($tims_path) ) {
mkdir ($tims_path, 0777);
}
file_put_contents ($tims_path.'/test.txt', 'Hello File');
if (is_dir($tims_path)) {
die( "timstring, you cannot use fopen on a directory path." );
}
//if the path is a directory and you want to put a new file there, you'll need to first check if it is writable:
if (!is_writable($tims_path)) {
die("timstring, " . $tims_path . " is not writable so you will not be able to write anything to it");
}
$FileName = $tims_path . $System . ' ' . $EndMO . '.csv';
$fh = fopen($FileName, "w");
Mkdir will not create the assigned folder. If I create the folder in Finder, the if(is_writable()) returns a negative. PHP can read and write to the parent folder. I have tried many many many combinations of permissions, all to no avail. Any ideas?