php move_uploaded_file not working on Windows 7 only
I've got a project that I am setting up file uploads for. The project is in Zend, but I am using PHP's $_FILES array and move_uploaded_file to save the files. This was working perfectly on my Windows Vista computer but won't save the file on Windows 7.
It creates a new folder for every upload no problem, but won't save the file and gives no error message. It is the same exact code as the other computer (grabbed from source control) and both are using PHP 5 with WAMP server. Any ideas why the Windows 7 computer won't save? I even added Full Control to 'Everyone开发者_开发技巧' for the uploads folders.
In Windows 7:
- Go to this location ->
C:\Windows\Temp
- Windows will ask permission- > press go or confirm or yes
- then try again to upload files
- finish
if your saving the files in the system drive, you might have a problem due to its security.. try to transfer your WAMP and PHP in other local drives. but if you insist to have it in your system file. just try to work around with its security.. Good Luck!
When you create the folder you want to move it to, are you setting the permissions in php? When I switched to windows 7 I had the same problem and setting the permissions solved it for me.
mkdir("/path/to/your/dir", 0777);
I read that chmod is ignore by windows on the php.net > mode reference. I was not able to mkdir on windows 7 by using mkdir /path/to/directory or path\to\directory\. I also tried editing the permissions for the parent (root?) directory I was using for the new folder. No solutions found here, yet. The folder reverts to read-only after unchecking the box on the folder settings though so maybe that is part of it
精彩评论