Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 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 March 25th, 2004, 10:36 AM
Authorized User
 
Join Date: Mar 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default Saving Files on the Client System

I am trying to find a way to allow my user to select the location he would like to save the output file on his system. When developing Windows apps you can use File Dialog boxes. Is there anything similar to this kind of control in ASP.NET? I know you can use the File Field for uploading but haven't found a counter part for downloading. Suggestions on how I might achieve the desired result?
Thanks in advance.
Brian

 
Old March 25th, 2004, 10:45 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I don't think you can do this. I may be wrong but it seems like a very serious security risk.
What's to stop me or someone malicious from sending myDoom to users who visit my site without them knowing?

 
Old March 25th, 2004, 10:49 AM
Authorized User
 
Join Date: Jan 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

After the processing takes place, you can try doing a response.redirect("/files/wordDoc.doc")

and alter the content type which may prompt the user with a "Save" Dialog.

 
Old March 25th, 2004, 12:24 PM
Authorized User
 
Join Date: Mar 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is there no way though to cause the user to view the same Save As box, for instance when you do a right click,"Target Save As"?
 
Old March 25th, 2004, 12:40 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

You could use JavaScript to do this:

<script language=javascript>
function save_as(path)
{
 document.execCommand("saveas",path);
}
</script>
<button onclick=save_as("c:\test.txt")>save</button>

HTH,

----------
---Snib---
----------

<><
 
Old March 25th, 2004, 01:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey Snib can you email me for a private question? Click on my name and send email. Thanks.






Similar Threads
Thread Thread Starter Forum Replies Last Post
saving files in windows format rage989 PHP How-To 0 August 30th, 2007 03:07 PM
To browse a file from client system Indraja ASP.NET 2.0 Basics 2 May 3rd, 2007 07:56 AM
Saving DataSet data on client machine in .csv file balesh ASP.NET 1.0 and 1.1 Professional 0 October 25th, 2006 06:17 AM
Saving file on client machine balesh ASP.NET 1.0 and 1.1 Professional 1 September 18th, 2006 07:49 AM
saving files using jscript shine Javascript How-To 2 January 2nd, 2004 11:56 AM





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