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

Downloading .exes with WebClient.DownloadFile

I'm having a problem using the System.Net.WebClient to download .exes from a web server. I'm testing everything on localhost, and the same code works fine with all other types of file. I even tried renaming the .exe extension of the file in question to .exe2, and that worked! Is there a security setting that doesn't let me download executables (the only error message I get is a timeout)? If so, is there a way to override it... I'm making a tool to update my software product over the Internet, and being able to download .exes is essential

Any suggestions, please?
Nov 22 '05 #1
18 4527
Hi James,

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Nov 22 '05 #2
Hi James,

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Nov 22 '05 #3
Hello,

Thanks for your post. As I understand, the problem you are facing is it
fails to download .exe fils by using WebClient. Please correct me if there
is any misunderstanding. I think more information is needed before moving
forward:

1. Could you download the file in Internet Explorer?

2. What's the error/exception message do you receive when it fails to
download?

3. Do you connect the Web Server via proxy?

I look forward to your reply. Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 22 '05 #4
Hello,

Thanks for your post. As I understand, the problem you are facing is it
fails to download .exe fils by using WebClient. Please correct me if there
is any misunderstanding. I think more information is needed before moving
forward:

1. Could you download the file in Internet Explorer?

2. What's the error/exception message do you receive when it fails to
download?

3. Do you connect the Web Server via proxy?

I look forward to your reply. Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 22 '05 #5
Check to see if the server allows you to download exe types. It may be
blocking downloads of executables.

"James" <ja*********@newsgroups.nospam> wrote in message
news:7F**********************************@microsof t.com...
I'm having a problem using the System.Net.WebClient to download .exes from a web server. I'm testing everything on localhost, and the same code works
fine with all other types of file. I even tried renaming the .exe extension
of the file in question to .exe2, and that worked! Is there a security
setting that doesn't let me download executables (the only error message I
get is a timeout)? If so, is there a way to override it... I'm making a tool
to update my software product over the Internet, and being able to download
..exes is essential!
Any suggestions, please?

Nov 22 '05 #6
Check to see if the server allows you to download exe types. It may be
blocking downloads of executables.

"James" <ja*********@newsgroups.nospam> wrote in message
news:7F**********************************@microsof t.com...
I'm having a problem using the System.Net.WebClient to download .exes from a web server. I'm testing everything on localhost, and the same code works
fine with all other types of file. I even tried renaming the .exe extension
of the file in question to .exe2, and that worked! Is there a security
setting that doesn't let me download executables (the only error message I
get is a timeout)? If so, is there a way to override it... I'm making a tool
to update my software product over the Internet, and being able to download
..exes is essential!
Any suggestions, please?

Nov 22 '05 #7
Thanks for your help... in response to your queries

1) No, I couldn't download the file in Internet Explorer. The progress bar at the bottom-right moved extremely slowly, and finally an error page showed: "CGI Timeout: The specified CGI application exceeded the allowed time for processing. The server has deleted the process". For all other files, there was no problem. It can't be file size either, as the .exe is only 340kb, and as I said renaming the extension works fine

2) When it fails to download and error handling is disabled, I receive a "timeout" message, after a long time in which the program does not respond

3) I don't really know what proxy is, I'm afraid! I am connecting through a wireless network in my home, which I set up myself and has no security features that I know of. I've checked through the IE security settings, and have found no applicable restrictions

Hope this helps..

James.
Nov 22 '05 #8
Thanks for your help... in response to your queries

1) No, I couldn't download the file in Internet Explorer. The progress bar at the bottom-right moved extremely slowly, and finally an error page showed: "CGI Timeout: The specified CGI application exceeded the allowed time for processing. The server has deleted the process". For all other files, there was no problem. It can't be file size either, as the .exe is only 340kb, and as I said renaming the extension works fine

2) When it fails to download and error handling is disabled, I receive a "timeout" message, after a long time in which the program does not respond

3) I don't really know what proxy is, I'm afraid! I am connecting through a wireless network in my home, which I set up myself and has no security features that I know of. I've checked through the IE security settings, and have found no applicable restrictions

Hope this helps..

James.
Nov 22 '05 #9
And I've just found something else! Every time I try to download the file, either in Internet Explorer or my program, it starts (and does not close) a new process which is visible in the Task Manager. This process has the same name as my file ("TMI Management.exe"). If I close this process before the usual timeout error occurs, I receive the following error: "CGI Error: The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: [blank]". It occurred to me that the computer may be trying to run, rather than download, the file. But I can't download notepad.exe either, so it's not specifically my application

Please advise

James.
Nov 22 '05 #10
And I've just found something else! Every time I try to download the file, either in Internet Explorer or my program, it starts (and does not close) a new process which is visible in the Task Manager. This process has the same name as my file ("TMI Management.exe"). If I close this process before the usual timeout error occurs, I receive the following error: "CGI Error: The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: [blank]". It occurred to me that the computer may be trying to run, rather than download, the file. But I can't download notepad.exe either, so it's not specifically my application

Please advise

James.
Nov 22 '05 #11
Hello James,

Thanks for your information. The following KB article discusses the similar
issue, please check if it helps.

Browser Stops Responding When .Exe File Attempts to Run Instead of Download
http://support.microsoft.com/?id=185379

I look forward to your response.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 22 '05 #12
Hello James,

Thanks for your information. The following KB article discusses the similar
issue, please check if it helps.

Browser Stops Responding When .Exe File Attempts to Run Instead of Download
http://support.microsoft.com/?id=185379

I look forward to your response.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 22 '05 #13
Okay thanks, removing execute permissions worked... but only for a while. Now whenever I try to download .exes (in both my app and Internet explorer), I receive an error: "An exception 'System.IO.FileNotFoundException' has occurred in IEExec.exe" and the option to debug (disassembly only)

I have no idea what I did to cause this new problem, as for a few hours everything worked smoothly. I've just tried re-installing the .NET framework, with no results, and I've got no idea what's wrong. I'd really appreciate some help asap! Thanks

James.
Nov 22 '05 #14
Okay thanks, removing execute permissions worked... but only for a while. Now whenever I try to download .exes (in both my app and Internet explorer), I receive an error: "An exception 'System.IO.FileNotFoundException' has occurred in IEExec.exe" and the option to debug (disassembly only)

I have no idea what I did to cause this new problem, as for a few hours everything worked smoothly. I've just tried re-installing the .NET framework, with no results, and I've got no idea what's wrong. I'd really appreciate some help asap! Thanks

James.
Nov 22 '05 #15
Hello James,

Thanks for your response.

1. Does the .exe file downloaded?

2. I suggest you to monitor the file access by using FileMon.exe which can
be downloaded from http://www.sysinternals.com/ntw2k/source/filemon.shtml.

3. Based on my research, I found the similar problem which was caused by
setting cache-control: no-cache header at IIS server. I suggest you to
perform the following steps:

a. Go to "Control Panel" -> "Administrative Tools" -> "Internet Information
Services Manager".
b. Right click "Web Sites" -> "Default Web Site", choose "Properties".
c. Select "HTTP Headers" and make sure "cache-control: no-cache" is not
listed.

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 22 '05 #16
Hello James,

Thanks for your response.

1. Does the .exe file downloaded?

2. I suggest you to monitor the file access by using FileMon.exe which can
be downloaded from http://www.sysinternals.com/ntw2k/source/filemon.shtml.

3. Based on my research, I found the similar problem which was caused by
setting cache-control: no-cache header at IIS server. I suggest you to
perform the following steps:

a. Go to "Control Panel" -> "Administrative Tools" -> "Internet Information
Services Manager".
b. Right click "Web Sites" -> "Default Web Site", choose "Properties".
c. Select "HTTP Headers" and make sure "cache-control: no-cache" is not
listed.

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 22 '05 #17
Thanks a lot, but somehow the problem has resolved itself again. I'm pretty sure there's something wrong with my computer

James.
Nov 22 '05 #18
Thanks a lot, but somehow the problem has resolved itself again. I'm pretty sure there's something wrong with my computer

James.
Nov 22 '05 #19

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

Similar topics

1
by: James | last post by:
I'm having a problem using the System.Net.WebClient to download .exes from a web server. I'm testing everything on localhost, and the same code works fine with all other types of file. I even tried...
4
by: Dino Buljubasic | last post by:
How can I download an image from a web server provided I have the url of image (i.e. http://mypictures.com/pics/picture01.jpg) ? Thank you
8
by: DEWright_CA | last post by:
Why does WebClient.DownloadFile loose my completed path? Ok, I have a function in my app then when my button is clicked it checks to see if the files come from a local drive or a http address....
1
by: A.M-SG | last post by:
Hi, I have an aspx page at the web server that provides PDF documents for smart client applications. Here is the code in aspx page that defines content type: Response.ContentType =...
5
by: roland.groenvynck | last post by:
I try to build my first web form application with C#. I want to program the downloading of a file to the client . Therefore I can use WebClient.DownloadFile (url, filepath ); I would like that...
1
by: vin.dor | last post by:
Dear All, I am using WebClient in my Visual Studio .Net 2003 project to download an image from the Internet. The following is my function: C# Code: public static bool downloadFile(string...
1
by: apondu | last post by:
Hi, I am new to web services and i am facing a problem. I am interested in downloading some file from internet and use it for furthur processing For eg. i have a file at a the following URL and...
1
by: apondu | last post by:
Hi, I am new to web services and i am facing a problem. I am interested in downloading some file from internet and use it for furthur processing For eg. i have a file at a the following URL and...
8
by: =?Utf-8?B?UnVpIE9saXZlaXJh?= | last post by:
WebClient.DownloadFile I am using the WebClient.DownloadFile function to download a file from server to a local client. When I execute the below code, file is created in server and not in...
1
by: manjuk | last post by:
Hello Problem: I need to download files from an FTP site while moving very fast. I expect connection problems during downloads. If a file is half downloaded and there is a connection glitch, then...
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
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
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
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.