acjetnut Posted September 13, 2007 Share Posted September 13, 2007 I am writing a very simple upload script that works beautifully on my *nix server. However, when I gave it to the person I wrote it for, I discovered that he uses a windows machine and it no longer works. I think the issue comes down to "mkdir()", as I have done extensive testing with it and even simple calls of the code will not work. Folder permissions are all "777". Anyone have any ideas? Code: <?php //get timestamp and make directory in ads folder $timestamp = time(); mkdir("./ads/$timestamp") or die ("Could not make directory"); //define path that will store file $target = "./ads/$timestamp/"; $target = $target . basename($_FILES['uploadedfile']['name']); //create text file that stores text form fields $infoText = "./ads/$timestamp/info.txt"; $fileHandle = fopen($infoText, 'w') or die("can't open file"); fwrite($fileHandle, $_POST['info']); fclose($fileHandle); //move file to storage path if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target)) { echo "The file " . basename($_FILES['uploadedfile']['name']) . " has been uploaded."; } else { echo "There was an error uploading the file, please try again!"; } ?> Link to comment https://forums.phpfreaks.com/topic/69252-mkdir-will-not-work-on-windows-system/ Share on other sites More sharing options...
darkfreaks Posted September 13, 2007 Share Posted September 13, 2007 <?php mkdir("./ads/$timestamp",0700);?> Link to comment https://forums.phpfreaks.com/topic/69252-mkdir-will-not-work-on-windows-system/#findComment-348014 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.