Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2004-09-25
5
330 Views
Last Modified: 2013-12-13
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.
0
Comment
Question by:aixarat
  • 2
  • 2
5 Comments
 
LVL 9

Expert Comment

by:techtonik
ID: 12155086
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.
0
 

Author Comment

by:aixarat
ID: 12155410
So there's no run-time override?
0
 
LVL 49

Expert Comment

by:Roonaan
ID: 12156197
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-
0
 

Author Comment

by:aixarat
ID: 12160043
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?
0
 
LVL 49

Accepted Solution

by:
Roonaan earned 250 total points
ID: 12160076
One of the items in the $_FILES arrays is the filename of the temporary file.

You could use file() or file_get_contents() to get the contents of this temporary file.

Use print_r($_FILES) to find the correct key, as I don't know it from heart.

-r-
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question