Writing a file on a shared host

  • Thread starter Thread starter anon
  • Start date Start date
A

anon

I am a bit of a newbie to asp.net, and I have purchased a cheap shared host
account to try to learn about it.

I've tried a few things quite successfully, but when I try to write an XML
file out (XmlTextWriter) it fails due to an unauthorised access. I think I
am probably trying to write to c:\

How do I write data to my home page area on the host disk?
 
You would create a virtual folder inside your website and allows the account
that runs your web site "write" privilege. Normally, it is ASPNET (a non-ad
Windows account)

John
 
You need to create a folder within your site and ask the host to grant write
permission for whatever account asp.net is running under. It is not always
the 'ASPNET' account. Some hosts create an account for each site.
If you don't want anyone else to be able to view/download the files in that
folder, you will also need to ask them to remove those permissions.
Otherwise, if someone typed the path/name of your file in their browser
address bar, they would view or be prompted to download the file depending
on what type of file it is.
I have run into this several times and usually it is not a problem to have
the permissions set even on a cheap host.

HTH
 
Back
Top