473,662 Members | 2,631 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.zi p' is denied.

While I was downloading with this code:
_webClient = new WebClient();
_webClient.Down loadFile(httpPa th, 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 3411

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 WindowsPrincipa l =
CType(System.Th reading.Thread. CurrentPrincipa l, WindowsPrincipa l)

//'Dim ident As IIdentity = user.Identity

string returnValue = string.Empty;

WindowsIdentity ident = WindowsIdentity .GetCurrent();

returnValue = ident.Name;

try

{

returnValue += " on " + System.Environm ent.MachineName ;

}

catch (Exception ex)

{

Conditionals.Tr ace.WriteMessag e(ex.Message);

}

return returnValue;

}

catch (Exception ex)

{

Conditionals.Tr ace.WriteMessag e(ex.Message);

return "Error Finding Identity";

}

}


"csharpula csharp" <cs*******@yaho o.comwrote in message
news:%2******** ********@TK2MSF TNGP04.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.zi p' is denied.

While I was downloading with this code:
_webClient = new WebClient();
_webClient.Down loadFile(httpPa th, 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
5644
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 the number and move over to the next field (using onBlur or...), I would like a popup/alert window warning them that this attachment size would take "x" amount of time based on a speed of 24 kilobits per second (kbps). If they are happy with the...
1
401
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 it (with Excel). When I deployed the application to a Windows Server 2003 Web Edition web server and clicked as before, I received error #404, file not found. Testing with a text file, instead of the "save/open" routine, the text file opened in...
6
18930
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 click a button and have a directory browser pop-up window available for the user to select the directory into which the image files will be downloaded. I thought that this would be simple to find but... If this is possible I further need to...
3
7370
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 +++++++++++ WebClient Client = new WebClient(); Client.DownloadFile(url, save_as);
0
1076
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 codings. The web layout is designed in with frame, using client script. Below are the tested result:
3
6785
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 = createobject("Wscript.shell") set oexec = ws.exec("<%=server.mapPath(./xx.vbs)%>") But it give error "the path/xx.vbs is not a valid win32 application" May i know why? I think some setting in registry will open the vbs file
6
2702
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. Since my application restricts the number of downloads for the file per user, i cannot show the user the URL/URI of the server hosting the file. Therefore i need to some how route the file via my webserver, and then use the Response to stream the...
2
6948
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 attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
1
47445
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 on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
8857
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
8768
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
8547
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,...
0
7368
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4181
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...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1754
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.