473,322 Members | 1,690 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

fppen------ How do I get permission to write to a html file?

I can write to this textfile:

$fp = fopen("./testfile.txt","w");

but not this html file:

$fp = fopen("./testfile.html","w");

How do I get permission to write to a html file?

Windows XP, IIS localhost

Thanks
Jul 17 '05 #1
7 2187
On Fri, 14 Jan 2005 20:59:12 -0000, "John" <jo**@al3home2003.freeserve.co.uk>
wrote:
I can write to this textfile:

$fp = fopen("./testfile.txt","w");

but not this html file:

$fp = fopen("./testfile.html","w");

How do I get permission to write to a html file?


Just change the permissions on testfile.html to match those of testfile.txt;
it's not a function of the extension.

What error do you get anyway? Are you sure it's a permissions problem?

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
*** John escribió/wrote (Fri, 14 Jan 2005 20:59:12 -0000):
How do I get permission to write to a html file?


Open explorer, find the file, right click on it, Properties, Security. You
can previously write down what permission you have in the file you can
edit.

In any case, it's far better to create a separate folder for files that
should be publicly writeable.

--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--
Jul 17 '05 #3
Thanks for your inputs - inspiration for more experiments.

I now find I can open and write to a .html file ok as long as I DON'T
create it or edit it with Dreamweaver MX.

The error displayed is:
Warning: fopen(./testfile.html) [function.fopen]: failed to open
stream: Permission denied in c:\Inetpub\wwwroot\php\TMP21iweacr8t.php
on line 61

The TMP file is produced from inside D.MX but I get the same error if
I go via the browser and D.MX is shut down.

There doesn't seem to be any visible difference to the attributes for
either file opened in the php code or created with D.MX

btw, I don't seem to get the "Security" tab that everyone's talking
about.
(XP Proffessional). In "properties" I get 4 tags: General, Sharing,
Web Sharing, Cusomize. But I'll deal with that elsewhere - it's not
exactly PHP...

Thanks
Jul 17 '05 #4
*** John escribió/wrote (Sat, 15 Jan 2005 10:04:58 -0000):
btw, I don't seem to get the "Security" tab that everyone's talking
about.
(XP Proffessional). In "properties" I get 4 tags: General, Sharing,
Web Sharing, Cusomize.


Is it an NTFS partition? FAT32 doesn't allow to restrict access to files.
BTW, you shouldn't open a new thread taking for granted everyone knows what
you're talking about ;-)
--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--
Jul 17 '05 #5
yes it is NTFS.
It's strange that in properties of a directory I can alter the option
button which is set at "Read-only" and click "Apply" or "OK", but when
I come back it's set at "Read-only" again. I thought the reason was
that you can't write to a directory anyway, but I don't know why it
goes through the motions.

Sorry about the new thread.
Also OE puts the original message at the end...

"John" <jo**@al3home2003.freeserve.co.uk> wrote in message
news:cs**********@newsg1.svr.pol.co.uk...
Thanks for your inputs - inspiration for more experiments.

I now find I can open and write to a .html file ok as long as I DON'T create it or edit it with Dreamweaver MX.

The error displayed is:
Warning: fopen(./testfile.html) [function.fopen]: failed to open
stream: Permission denied in c:\Inetpub\wwwroot\php\TMP21iweacr8t.php on line 61

The TMP file is produced from inside D.MX but I get the same error if I go via the browser and D.MX is shut down.

There doesn't seem to be any visible difference to the attributes for either file opened in the php code or created with D.MX

btw, I don't seem to get the "Security" tab that everyone's talking
about.
(XP Proffessional). In "properties" I get 4 tags: General, Sharing,
Web Sharing, Cusomize. But I'll deal with that elsewhere - it's not
exactly PHP...

Thanks

Jul 17 '05 #6
*** John escribió/wrote (Sat, 15 Jan 2005 12:25:46 -0000):
yes it is NTFS.


Then you probably have the "Use simple file sharing" option set in "Folder
options" (name may differ, I'm translating from Spanish). Despite its name,
that option makes file permission handling rather complicate.

--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--
Jul 17 '05 #7
You are right. Thank you sir!

"Alvaro G. Vicario" <kA*****************@terra.es> wrote in message
news:1d*******************************@40tude.net. ..
*** John escribió/wrote (Sat, 15 Jan 2005 12:25:46 -0000):
yes it is NTFS.
Then you probably have the "Use simple file sharing" option set in

"Folder options" (name may differ, I'm translating from Spanish). Despite its name, that option makes file permission handling rather complicate.

--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie) ++ Las dudas informáticas recibidas por correo irán directas a la papelera -+ I'm not a free help desk, please don't e-mail me your questions
--

Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Hai Nguyen | last post by:
Hi all I'm coding a Web application which requires to write an XML file into a folder. I'm wondering other than account Everyone which else I can set permission so that my application can have...
9
by: Jay Kim | last post by:
Hi, We're implementing a Windows application using Visual Basic .NET. One of the key features we need to implement is that we should be able to get the accurate byte offset of user selected...
2
by: ykgoh | last post by:
Hi. I've a problem of being able to create and remove a directory but unable to write a file inside the created directory for some strange reason. I suspect that this problem could be vaguely...
3
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 ...
9
by: Niron kag | last post by:
Hello ! With c# , I want to create a HTML file programatically . How can I do it ? Thank U !
2
by: Bina | last post by:
hi, I want to read & write a html file which contain the japanese character. Now how i will do it?I can read & write english character . but when i read & write Japanese character from the html...
8
by: jld730 | last post by:
I have been given a snippet of HTML code that I am to use Python to write it out. I am somewhat new to Python, and completely new to HTML, so I'm still unclear on what it is I am supposed to be...
6
by: Thanh-Nhan Le | last post by:
Hello, I have an ASP application on IIS server: http://localhost/myApp I use ASP and a my own VB activex DLL to create a pdf file and write this file to a subfolder of the Application folder:...
6
by: Shawn | last post by:
Hello: I have the following code in a PHP file. An HTML form passes user comment data to the PHP, which then appends the user comments to the end of the HTML file on which the form is located....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.