Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-09-25
5
Medium Priority
?
351 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
[X]
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
  • 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 750 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

604 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