473,396 Members | 1,966 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,396 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 12 '05 #1
5 1666
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 12 '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 12 '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 12 '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 12 '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 12 '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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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,...

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.