473,394 Members | 2,090 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,394 software developers and data experts.

Acccess to a file on desktop is denied

Hello:

I have an ASP application that takes a file and parses it.
I have a fileUpload control on my ASP page. Here's the code that gets file
details:

Dim srFile As StreamReader

Try
srFile = New StreamReader(getFile.PostedFile.FileName)
Catch ex As Exception
Err.Raise(_iErrorbase + 0, "ProcessFile", ex.Message)
Return False
End Try

When I am prompted and I choose a file anywhere but my desktop, the code
does not raise an exception. But if I choose a file that is on my Desktop, it
says "Access to ... is denied".

And, it does not happen on my development box but it happens on the
prooduction box.

Can somebody shed light on this issue?
Oct 31 '06 #1
4 1149
"vvenk" <vv***@discussions.microsoft.comwrote in message
news:3E**********************************@microsof t.com...
Hello:

I have an ASP application that takes a file and parses it.
I have a fileUpload control on my ASP page. Here's the code that gets file
details:

Dim srFile As StreamReader

Try
srFile = New StreamReader(getFile.PostedFile.FileName)
Catch ex As Exception
Err.Raise(_iErrorbase + 0, "ProcessFile", ex.Message)
Return False
End Try

When I am prompted and I choose a file anywhere but my desktop, the code
does not raise an exception. But if I choose a file that is on my Desktop,
it
says "Access to ... is denied".
I don't use asp much but is getFile.PostedFile.FileName the file on the
user's machine? If that's the case then it will be working only because the
server and client are the same machine, if this was a real web situation it
would not work. The reason it fails for desktop is that the asp user doesn't
have access to your desktop.

Michael
Oct 31 '06 #2
Michael:

How would I then access a file that's on the user's desktop?

"Michael C" wrote:
"vvenk" <vv***@discussions.microsoft.comwrote in message
news:3E**********************************@microsof t.com...
Hello:

I have an ASP application that takes a file and parses it.
I have a fileUpload control on my ASP page. Here's the code that gets file
details:

Dim srFile As StreamReader

Try
srFile = New StreamReader(getFile.PostedFile.FileName)
Catch ex As Exception
Err.Raise(_iErrorbase + 0, "ProcessFile", ex.Message)
Return False
End Try

When I am prompted and I choose a file anywhere but my desktop, the code
does not raise an exception. But if I choose a file that is on my Desktop,
it
says "Access to ... is denied".

I don't use asp much but is getFile.PostedFile.FileName the file on the
user's machine? If that's the case then it will be working only because the
server and client are the same machine, if this was a real web situation it
would not work. The reason it fails for desktop is that the asp user doesn't
have access to your desktop.

Michael
Nov 1 '06 #3
Michael:

But if I choose a file anywhere else on the user's machine (c:\, anything),
it works fine.

The problem is only when I select something on the user's desktop.

"Michael C" wrote:
"vvenk" <vv***@discussions.microsoft.comwrote in message
news:3E**********************************@microsof t.com...
Hello:

I have an ASP application that takes a file and parses it.
I have a fileUpload control on my ASP page. Here's the code that gets file
details:

Dim srFile As StreamReader

Try
srFile = New StreamReader(getFile.PostedFile.FileName)
Catch ex As Exception
Err.Raise(_iErrorbase + 0, "ProcessFile", ex.Message)
Return False
End Try

When I am prompted and I choose a file anywhere but my desktop, the code
does not raise an exception. But if I choose a file that is on my Desktop,
it
says "Access to ... is denied".

I don't use asp much but is getFile.PostedFile.FileName the file on the
user's machine? If that's the case then it will be working only because the
server and client are the same machine, if this was a real web situation it
would not work. The reason it fails for desktop is that the asp user doesn't
have access to your desktop.

Michael
Nov 1 '06 #4
Perhaps this will help:
http://www.microsoft.com/downloads/d...DisplayLang=en

Brief Description
This application compatibility tool helps developers and IT
professionals diagnose issues that would prevent a program from running
properly as a standard user.

Introduction

The "Standard User Analyzer" (previously known as the "LUA
Analyzer") is a tool to help independent software vendors (ISVs), IT
professionals, and end users diagnose possible issues in an application
when it is running as a standard user. The Standard User Analyzer is
based upon the "LUA Predictor" technology, which is part of the
Microsoft Application Verifier.

Installation Prerequisites and Compatibility

Operating systems: Windows Vista, Windows XP, and Windows Server 2003.

Note: Currently, only a 32-bit version of the Standard User Analyzer is
available.

Installation prerequisites: The Application Verifier must be installed
before the Standard User Analyzer installation is launched. The
Application Verifier is a free download on the Microsoft Web site.

But maybe not. I installed it and it gives a lot of information but
I'm not sure what to do with it all. It doesn't give you step by step
instructions on how to fix a line of your code. It's pretty cryptic -
to me at least.
Regards,
ImageAnalyst
vvenk wrote:
Hello:

I have an ASP application that takes a file and parses it.
I have a fileUpload control on my ASP page. Here's the code that gets file
details:

Dim srFile As StreamReader

Try
srFile = New StreamReader(getFile.PostedFile.FileName)
Catch ex As Exception
Err.Raise(_iErrorbase + 0, "ProcessFile", ex.Message)
Return False
End Try

When I am prompted and I choose a file anywhere but my desktop, the code
does not raise an exception. But if I choose a file that is on my Desktop, it
says "Access to ... is denied".

And, it does not happen on my development box but it happens on the
prooduction box.

Can somebody shed light on this issue?
Nov 1 '06 #5

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

Similar topics

26
by: Don | last post by:
I'm writing an html page with some JavaScript that reads a web page into a client-side temp file, then reformats it, then submits that same file as a URL to the browser for display, via...
1
by: Darren Lew | last post by:
Hi there, I have this problem which is really driving me nuts for a couple of days. Glad if any help or suggestion is given Javascript will give me a pop-up error "Access is denied" when i try...
4
by: Curt Emich | last post by:
I recently bought a copy of Visual C#.NET Deluxe Learning addition. I was under the impression that this comes with SQL Server Desktop Engine. I installed everything I should have (I think), but...
7
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...
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 ...
2
by: Bill Sempf | last post by:
Hi, all. I have a networking question, really. I have this line of code: my.computer.network.downloadfile("\\1.2.3.4\c$\file.txt", "c:\ifle.txt", "user", "pass") When I run it, I get an...
9
by: Matt | last post by:
How would I do this ... I want to set the Windows Scheduler to run the ..bat file which will open an access database at like 2 in the AM. What code do I need in the .bat file.
4
by: crazydoc | last post by:
HI friends I have noticed that there is a file desktop.ini usually of 66kb in every folder and also a folder system volume information which is empty and access denied along with recycler folder...
3
by: sasimca007 | last post by:
Hi friends, I have one small doubt that is, i have to copy one file from tmp folder to the desktop. This is a modperl program, when i write linux command in that modperl program it...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.