Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Distributed Applications / September 2005

Tip: Looking for answers? Try searching our database.

problem in downloading exe file from website

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tushar.n.patel@gmail.com - 26 Sep 2005 13:26 GMT
hi,
  i've made one .exe application in .net 1.1 and upladed to one
server. the problem is when i click on the link, instead of downloading
it like normal exe file it is opening it. i want to download the exe as
it also has some DLLs which needs to be deployed at client side b4
application starts.
  anybody has any solution plz do share with me.

thanks
Michael Nemtsev - 27 Sep 2005 08:31 GMT
Hello tushar.n.patel@gmail.com,

FW1.1 don't give u ability to do a such thing automatically.

FW 2.0 supply ClickOnce to do it

> i've made one .exe application in .net 1.1 and upladed to one
> server. the problem is when i click on the link, instead of
[quoted text clipped - 5 lines]
> anybody has any solution plz do share with me.
> thanks

---
WBR,
Michael  Nemtsev :: blog: http://spaces.msn.com/members/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
tjfdownsouth - 29 Sep 2005 04:17 GMT
I had to add some nonsense to my webpage that would tell IIS to download the
file and not try to process

private void DownloadFile(string virtualPath)
{
string filePath = Server.MapPath(virtualPath);
FileInfo targetFile = new FileInfo(filePath);
// clear the current output content from the buffer
Response.Clear();
// add the header that specifies the default filename for the
download/saveas dialog
Response.AddHeader("Content-Disposition","attachment; filename=" +
targetFile.Name);
// add the header that specifies the file size so that the browser can show
the progress
Response.AddHeader("Content_Length",targetFile.Length.ToString());
// specify that th eresponse is a stream that cannot be read by the client
and must be downloaded
Response.ContentType = "application/octet-stream";
// send the file stream to the client
Response.WriteFile(targetFile.FullName);
// stop the execution of this page
Response.End();
}

hope this helps

> Hello tushar.n.patel@gmail.com,
>
[quoted text clipped - 18 lines]
> "At times one remains faithful to a cause only because its opponents do not
> cease to be insipid." (c) Friedrich Nietzsche

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.