473,396 Members | 1,755 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.

Download Error (Web Client)


Hello,
I am trying to download a file and get a current error:

Download(...): Unable to download file

Access to the path 'C:\Temp\aaa.zip' is denied.

While I was downloading with this code:
_webClient = new WebClient();
_webClient.DownloadFile(httpPath, filePath);
Another thing is that I am doing this action for few threads and each
thread creates it's own filePath (but I don't think it's related to it).

How to avoid this error?

Thank you!

*** Sent via Developersdex http://www.developersdex.com ***
Nov 20 '08 #1
1 3388

Does C:\temp\
already exist?

If not, experiment with making the directory before downloading.

Who is trying to save the file?

Here is some VERY CRAPPY code to identify the "who".

private string FindIIdentity()

{

try

{

//'Dim user As WindowsPrincipal =
CType(System.Threading.Thread.CurrentPrincipal, WindowsPrincipal)

//'Dim ident As IIdentity = user.Identity

string returnValue = string.Empty;

WindowsIdentity ident = WindowsIdentity.GetCurrent();

returnValue = ident.Name;

try

{

returnValue += " on " + System.Environment.MachineName;

}

catch (Exception ex)

{

Conditionals.Trace.WriteMessage(ex.Message);

}

return returnValue;

}

catch (Exception ex)

{

Conditionals.Trace.WriteMessage(ex.Message);

return "Error Finding Identity";

}

}


"csharpula csharp" <cs*******@yahoo.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>
Hello,
I am trying to download a file and get a current error:

Download(...): Unable to download file

Access to the path 'C:\Temp\aaa.zip' is denied.

While I was downloading with this code:
_webClient = new WebClient();
_webClient.DownloadFile(httpPath, filePath);
Another thing is that I am doing this action for few threads and each
thread creates it's own filePath (but I don't think it's related to it).

How to avoid this error?

Thank you!

*** Sent via Developersdex http://www.developersdex.com ***

Nov 20 '08 #2

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

Similar topics

4
by: - - Pierre | last post by:
Hi all, I'm trying to come up with a script and I'm having a heck of a time... I require users to enter the size (in MB or KB) of the attachment they wish to transfer/upload. As they enter...
1
by: Craig Conly | last post by:
I was able on an XP machine to use an HTML button with the following client-side javascript: onclick="window.navigate('/xxxxxx.cub')" that would allow the client to either save the file or open...
6
by: Glenn Owens | last post by:
As a "newbie" to Javascript I need some help with my latest problem... I have a number of image files that have been pre-selected by the user for downloading. I'd like to be able to have the user...
3
by: Du Dang | last post by:
i wanna create a bot to download wallpaper from a website cuz there are thousands of pic availiable and right click and "save as" ain't fun no more so far i got this from google +++++++++++ ...
0
by: Kelmen Wong | last post by:
Greeting, We have an ASP.NET app, developed using c#. There's a feature which a page (UserControl) when postback, it will download a PDF/Excel file through typical Response and Content Header...
3
by: kim | last post by:
GOOD morning, I try to open xx.vbs in <href="./xx.vbs"></hef> but it pop up the file download mesage. How can i disabled it? I try another solution like this : set ws =...
6
by: Jatin | last post by:
Hey Guys I have a web application that allows users to download files. But the files are not hosted on the webserver. The files are stored on external servers and are referenced by a URL/URI....
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...

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.