473,657 Members | 2,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to access a network file path \\foo\bar.txt from an .aspx and from a custom IHttpHandler?

How to access a network file path \\foo\bar.txt from an .aspx and from a
custom IHttpHandler?

How to specify which account that aspx application should use when doing
file IO from network paths?

When I try to open the file from .aspx the file read throws: Logon failure:
Logon failure: unknown user name or bad password.
When I try to open the file from a custom IHttpHandler the file read throws:
Logon failure: unknown user name or bad password.

\\foo\bar.txt grants read access to the group "Everyone" and everyone but my
aspx application are able to read \\foo\bar.txt

How to specify which account that aspx application should use when doing
file IO from network paths?
Mar 15 '06 #1
1 3537
if i add

<identity impersonate="tr ue" userName="domai nzzz/userzzz" password="passz zz"
/>

to my web config i just get error 500

"Daniel" <so************ *******@yahoo.c om> wrote in message
news:ew******** *****@TK2MSFTNG P10.phx.gbl...
How to access a network file path \\foo\bar.txt from an .aspx and from a
custom IHttpHandler?

How to specify which account that aspx application should use when doing
file IO from network paths?

When I try to open the file from .aspx the file read throws: Logon failure: Logon failure: unknown user name or bad password.
When I try to open the file from a custom IHttpHandler the file read throws: Logon failure: unknown user name or bad password.

\\foo\bar.txt grants read access to the group "Everyone" and everyone but my aspx application are able to read \\foo\bar.txt

How to specify which account that aspx application should use when doing
file IO from network paths?

Mar 15 '06 #2

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

Similar topics

8
11841
by: Lam | last post by:
HI anyone knows how can I open a mapped network file in C#? I try string file = @"T:\file.txt"; it shows me the error: "Could not find a part of the path" but if I copy the file to my C dirve, and use @"C:\file.txt"; it worked Thanks a lot
1
1133
by: Rea Peleg | last post by:
Hi all There seem to be a problem when i attempt to add attachment from the client machine to the mail message sent from the web aspx server application. I am using dot net and i expect security issues to block attempts from aspx code to access the file system on client machine but not sure how to over come this. I suspect security because the same code runs just fine when executed by a console application.
7
5827
by: zxkuqyb | last post by:
I've written a simple ASP .NET web application that reads a text file and displays it in the web browser. Works fine when reading a local path; but fails with "can not find a part of the path", or "can not access network file" when attemting to access a UNC network path. I am using IIS 6.0 on Server 2003. SharePoint Portal Server is also installed on this server. I have granted full access to 'everyone' on the network file. An...
3
1211
by: Rudy | last post by:
Hello! I know you can save the file path to SQL from where you took a file from, like c:/documents.mypictures. And you would use the sFileName = browsefile.PostedFile.FileName But if I want to save the file path of the folder I'm saving to like c:/newpictureplace. How would I code that?
4
1402
by: A.M-SG | last post by:
Hi, I need an aspx's code behind program access to a network folder which is only available for specific active directory user. How can I have that specific aspx code login into the active directory with specific UID/PWD? The rest of ASPX pages in the application don't need to have any access to file resources. Thank you,
3
7953
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?
1
440
by: Daniel | last post by:
How to access a network file path \\foo\bar.txt from an .aspx and from a custom IHttpHandler? How to specify which account that aspx application should use when doing file IO from network paths? When I try to open the file from .aspx the file read throws: Logon failure: Logon failure: unknown user name or bad password. When I try to open the file from a custom IHttpHandler the file read throws: Logon failure: unknown user name or bad...
0
420
by: ary | last post by:
hi all I have a problem with working file when i upload a file in IIS I can'd Delete it. if I try to delete it in debug mode , it successfully worked. my error message "the process cannot access the file "path\filename.jpg" because it is being used by another process".
0
1098
by: ashokformac | last post by:
I am using java on mac os 10.4 i want to access a file on LAN server machine.how can i give the server path...ie for local file i just give direct filename ie .. /system/ashok/temp.txt but suppose i want to access a file on server machine (eg. is-s234) and file name is temp.txt for thi9s how can i write the filepath ...
4
2884
by: GiJeet | last post by:
Every example I see regarding opening a file uses paths like this: FileStream inputStream = new FileStream ("C:\\file.txt", FileMode.Open, FileAccess.Read); Great if the file is always on the root of the C: drive but what if that’s not the case?! If I add a file to a project in my solution I can’t hard code the path to the file which lives in something like C:\Documents and Settings \Administrator\My Documents\Visual Studio...
0
8324
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
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
8516
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,...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
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...
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1733
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.