Link to home
Start Free TrialLog in
Avatar of aixarat
aixarat

asked on

UPLOAD ERROR: move_uploaded_file FILENAME failed to open stream: Permission denied on line #

I'm getting the error on title when trying to upload a text file to a Windows server. I'm developing on a localhost windows computer, and I can upload internally without problems, however when using the same script to upload a 300K text file in the remote Windows server it sends the warning on the title.

There was a similar problem listed in this forum, but the remote server was Unix, so the answer does not apply here. I tried that solution (ftp a file with the exact same name in the remote location and CHMOD it to 777) but since it is a Windows server CHMOD does not work. I only have FTP access to the remote server.

Help is sincerely appreciated.
Avatar of techtonik
techtonik

If you have only FTp access, then you cannot do anything except to contact your hosting support team on this issue so they can change configuration to allow webserver upload/write privileges to your chosen direcory.
Avatar of aixarat

ASKER

So there's no run-time override?
Avatar of Roonaan
Well, as the error occurs when executing move_uploaded_file, you could open - in your phpscript - an ftp connection and move the file using this connection from the temporary upload dir to the dir you require it to be. Possible problems could be the max numbers of ftp connections and slow ftp servers. But it sure would be a workaround, which in your case could be handy.

-r-
Avatar of aixarat

ASKER

The reason that I'm trying to use move_uploaded_file is that I'm trying to build a simple file uploading system for a feature in a particular website. I'm already FTPing to gen my files on place.
I'm thinking about a possible workaround: is there a way to directly open the uploaded file without moving it to a new folder? I suppouse that will also require me to delete it from the temp folder... Any comments?
ASKER CERTIFIED SOLUTION
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial