473,769 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File write permission denied on Windows host

81 New Member
I'm running a PHP 5.1 on an Apache 2.2 server under Windows XP which I use to develop my web apps.
Currently, I am trying to add "upload" functionality to my project, but for some reason, when the move_uploaded_f ile() function is called on it, the following error is generated:
Warning: move_uploaded_f ile(D:/web_services/httproot/nbprj/img/u) [function.move-uploaded-file]: failed to open stream: Permission denied in D:\Web_Services \php_include\ad min\manimgs.php on line 120

Warning: move_uploaded_f ile() [function.move-uploaded-file]: Unable to move 'D:\Web_Service s\http_inc\phpC 4.tmp' to 'D:/web_services/httproot/nbprj/img/u' in D:\Web_Services \php_include\ad min\manimgs.php on line 120
Now this error may appear to be simple write permission issue, but the account that is running the service has full r/w permissions to the directory that is supposed to host the uploaded file:
Expand|Select|Wrap|Line Numbers
  1. D:\Web_Services\httproot\nbprj\img\u>echo %USERNAME%
  2. Web Service
  3.  
  4. D:\Web_Services\httproot\nbprj\img\u>echo "some text" >> file.txt
  5.  
  6. D:\Web_Services\httproot\nbprj\img\u>type file.txt
  7. "some text"
  8.  
  9. D:\Web_Services\httproot\nbprj\img\u>del file.txt
  10.  
  11. D:\Web_Services\httproot\nbprj\img\u>
See the attachment for a screenshot on my permission settings.

I'm certain that "Web Service" is the account that is running the httpd server.
Any ideas what is causing me a headache?
Attached Images
File Type: jpg sec_perms.jpg (10.1 KB, 431 views)
Jun 3 '09 #1
3 7726
Markus
6,050 Recognized Expert Expert
Try chmod()ing the directory prior to your upload.
Jun 3 '09 #2
unauthorized
81 New Member
@Markus
I did a chmod($path, 0777) but the result is still the same.
Jun 3 '09 #3
unauthorized
81 New Member
Resolved.
My code was not adding the file name to the move_uploaded_f ile() function and thus the script was failing to overwrite the existing directory with the uploaded file.
Very careless of me, I know.
Jun 3 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

11
21111
by: Richard Muller | last post by:
Hi, I new to ASP. I have a problem with an ASP script opening a file for writing on my server. Here's how I got to this error: I downloaded a neat FileUpload ASP example from http://www.asp101.com/articles/jacob/scriptupload.asp. I copied to my wwwroot folder on my Win2000AS/SP4 server: - main .asp file
2
2281
by: clintonG | last post by:
The application is a simple form of three textbox controls that results in writing an XML file to the file system of the application root when it runs on the local development machine. I've just used FTP to deploy this as my first ASP.NET application using a hosting provider using W2003 IIS6 noting the host provides a control panel that allows me to set the application root as a virtual application. The XML file is not being created...
10
3069
by: M K | last post by:
I get the message: 'Could not use ''; file already in use.' on my pages if I am working in the database. I used to be able work in the database (Access) and users use the site, but I tried to install Remote Debugging tools from VStudio 2k3 and since then it has been messed up. Please, this is very important for us to fix. We are having errors if two or more people are on the site at the same time.
1
8136
by: Duffman | last post by:
Hi, I have what seems to be a common problem, but the solutions I've found don't seem to work. I would like to use a web service to create a file at a UNC location in a shared file. Currently I'm just running it locally and saving the file locally using my machines UNC path. I have given user ASPNET full control over the folder I want to write the file to. I've also tried using the web config identity impersonation to use my user...
3
7965
by: David Thielen | last post by:
Hi; I created a virtual directory in IIS 6.0 and my asp.net app runs fine. But when it tries to write a file I get: Access to the path is denied. - C:\Inetpub\wwwroot\RunReportASP\images C:\Inetpub\wwwroot\RunReportASP is the directory of my virtual directory for my app. In it's properties I did check "Write" as a permission. What else do I need to do?
15
2836
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. Everything is the default settings I believe. IIS is running under Local System. In IIS the DefaultAppPool is running under Network Service. Annonymous access uses the account IUSR_JASMINE (machine name is Jasmine).
1
3281
by: igotyourdotnet | last post by:
Ok, here is the issue: I have 2 web pages one does a file upload to a database and the other page does a FTP to a server, both pages use the c:\temp directory. The page that uploads to a database works fine, the page that FTP's the files returns me an error (Access denied filename.txt) Now the asp.net ID has full control of the c:\temp directory. The only difference in the 2 pages is that page 2 creates a text file writes data to it then...
0
6856
by: phil469 | last post by:
I'm having an issue when trying to read a file in a user's homedir from a cgi script. I have a virtual host section in my httpd.conf file which I'll include. The cgi script is a very basic script written in Perl just for testing. I believe I need to find the correct <Directory> entry or some other Directive in Apache to make this work, but I've had no luck for a week now. I've tried many different things, but w/ no luck. I even tried adding...
4
2672
by: xzzy | last post by:
I have a v1.1 web app that works on my local computer. However, running it at the host computer, the following breaks: when a viewer selects a different country, the State dropdown should repopulate with the new country's state/proviences. Running on the host, the dropdown does not repopulate and says 'Permission Denied', I take this to mean that at the host, a viewer does not have permission to put new items in the State dropdown.
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10047
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.