473,323 Members | 1,589 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,323 software developers and data experts.

saving file from asp.net

Hi all,
I dynamically generate Word Documents from my web application using
XmlDocument object and need to save them on a mapped network drive. I use
the Save method of XmlDocument object to save documents. Ican save them
successfully on local drive on web server. But when I try to save them on a
mapped network drive, I get permission denied errors. I made sure that
ASPNET had full access right in the folder where I need to save documents. I
also tried using UNC path, but that also does not work. Can someone please
point to what I may be doing wrong and explain the whole setup process for
being able to save documents from asp.net application?

Thanks in advance.
Nov 19 '05 #1
5 809
I would not grant the ASPNET user the rights you need. Rather, I would
impersonate a user that has the appropriate rights.

Also, what are the details of the error that you are getting?

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"helpful sql" <no****@stopspam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi all,
I dynamically generate Word Documents from my web application using
XmlDocument object and need to save them on a mapped network drive. I use
the Save method of XmlDocument object to save documents. Ican save them
successfully on local drive on web server. But when I try to save them on
a mapped network drive, I get permission denied errors. I made sure that
ASPNET had full access right in the folder where I need to save documents.
I also tried using UNC path, but that also does not work. Can someone
please point to what I may be doing wrong and explain the whole setup
process for being able to save documents from asp.net application?

Thanks in advance.

Nov 19 '05 #2
ASPNET does not have directory level access to your user folders obviously..
as for impersionation... you would have a problem when the user changed
their password and would need to update the impersionated password each time
it changed... so you'd have your choice between assigning ASPNET write
access to the folder you are trying to work with, or impersonating a user
and making sure you know their correct current password to gain access..
"helpful sql" <no****@stopspam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi all,
I dynamically generate Word Documents from my web application using
XmlDocument object and need to save them on a mapped network drive. I use
the Save method of XmlDocument object to save documents. Ican save them
successfully on local drive on web server. But when I try to save them on
a mapped network drive, I get permission denied errors. I made sure that
ASPNET had full access right in the folder where I need to save documents.
I also tried using UNC path, but that also does not work. Can someone
please point to what I may be doing wrong and explain the whole setup
process for being able to save documents from asp.net application?

Thanks in advance.

Nov 19 '05 #3

"helpful sql" <no****@stopspam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi all,
I dynamically generate Word Documents from my web application using
XmlDocument object and need to save them on a mapped network drive. I use
the Save method of XmlDocument object to save documents. Ican save them
successfully on local drive on web server. But when I try to save them on
a mapped network drive, I get permission denied errors. I made sure that
ASPNET had full access right in the folder where I need to save documents.
I also tried using UNC path, but that also does not work. Can someone
please point to what I may be doing wrong and explain the whole setup
process for being able to save documents from asp.net application?

Thanks in advance.


How did you manage to give aspnet access rights to a mapped network drive?
ASPNET is a local account, so it's not possible to grant right to this
account on another server!! (Note that ASPNET on one server is not the same
account as ASPNET on another server).

What you can do is impersonate a domain account in your web application. Or
much better "delegate" the document creation and writing to a COM+
(EnterpriseServices) server type application. This application could run
with domain account credentials valid to access the remote share, and can
implement fine grained access permissions through role membership.

Willy.

Nov 19 '05 #4
Willy is correct here. I would add that if you decide to use
impersonation, you need to make sure that you use a domain account
whose password does not expire; almost all enterprises expire passwords
every so often for security purposes.

sayed

Nov 19 '05 #5

<ha**********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Willy is correct here. I would add that if you decide to use
impersonation, you need to make sure that you use a domain account
whose password does not expire; almost all enterprises expire passwords
every so often for security purposes.

sayed


One (good) enterprise policy is not to use normal "domain accounts" at all
for services, instead you should use special DOMAIN accounts created as a
Kerberos Service Account (SPN's).

Willy.

Nov 19 '05 #6

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

Similar topics

7
by: G-Factor | last post by:
Hi all I've just started learning about saving files. I got bit of a problem. The following code gives me an error about incompatible types. (Cannot covert from class character to char *). I...
4
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
15
by: Dan DeConinck | last post by:
Hello, I want to save the position of all the controls on my form. I would like to write them out to a preference file. I have done this in DOS BASIC like this: TO WRITE the preference...
5
by: TheGanjaMan | last post by:
Hi everyone, I'm trying to write up a simple image stamper application that stamps the Exif date information from the jpegs that I've taken from my digital camera and saves the new file with the...
4
by: Pedro Leite | last post by:
Good Afternoon. the code below is properly retreiving binary data from a database and saving it. but instead of saving at client machine is saving at the server machine. what is wrong with my...
6
by: Mark Denardo | last post by:
My question is similar to one someone posted a few months back, but I don't see any replies. Basically I want to be able to have users upload photos and save them in a database (as byte data)...
0
by: Speilman_54 | last post by:
Hi, I'm converting an excel Macro into visual basic 2005 express, as I don't have a copy of VB 6 and trying to make and executable from it, I know this version doesn't have the save file as .exe,...
1
by: Allie | last post by:
Hi, all. This might be a silly question... but I am very new to programming in SQL so please bear with me :) So. I'm using MS SQL Server 2005 Management Studio Express. I have a table that...
6
by: Karl | last post by:
Hi all, It may seem like a rather odd request (or not) but I would like to be able to create a file (doc, jpg, xls or one of many other files that can be automated) on a website and stream it to...
6
by: Eddie | last post by:
Hi all, I am displaying a number of reports, and giving the users an option to display them on the web or download them to Excel. If they want the Excel file, I just use the PHP header command...
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
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...
1
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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)...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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.