Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 1st, 2006, 02:49 PM
Authorized User
 
Join Date: Jan 2006
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default Downloading a File

I've got a job where the client would like to be able to download documents - Word, Excel, PowerPoint. The problem is that if I just point the browser to one of these files (sitting on an http server), the file will open in a browser window. Instead, I want to display a "Save As" dialog box which will allow the user to download the file to a directory.

Can this be done with ASP.NET 2.0? In looking through the .NET help, I see there's a WebRequestMethods class, but I have no idea if this is part of the solution.
 
Old February 1st, 2006, 04:36 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Rob,

Take a look at this article: http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=189

It's written for classic ASP, but the same principle applies to ASP.NET. In ASP.NET, there is a WriteFile method of the Response object to simply things even further....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old February 2nd, 2006, 10:14 AM
Authorized User
 
Join Date: Jan 2006
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Imar, I figured it out.

I have to say, I sometimes feel bewildered by the .NET help system. Much of it seems to be written for people who are already proficient with .NET.

Rob
 
Old February 3rd, 2006, 07:07 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

For the benefit of the archive, would you mind sharing how you fixed it?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old February 4th, 2006, 09:37 PM
Authorized User
 
Join Date: Jan 2006
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here's a link:
http://aspalliance.com/259





Similar Threads
Thread Thread Starter Forum Replies Last Post
Logging into a site and downloading a file lokilewis ASP.NET 1.0 and 1.1 Basics 3 June 10th, 2007 09:59 AM
Flash file downloading Adam H-W Flash (all versions) 1 December 15th, 2006 11:36 PM
Problem with SendKeys while downloading a file desperado1306 Excel VBA 0 May 25th, 2006 12:05 PM
Downloading Excel File [email protected] VB How-To 0 October 28th, 2004 11:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.