save file

  • Thread starter Thread starter Guest
  • Start date Start date
then how can i save a file to the clients PC from the web page?

without having them do a right click and Save Pic As?
 
Write an ActiveX control in unmanaged code, otherwise the user has to
initiate the saving. Just give the user instructions on the page indicating
that they have to take some action to download the content.
 
You can zip the file, and redirect the user to it.
Then the dialog will appear automatically.
 
Assuming you're talking specifically about images, these are the easy
options;

1. Explain to the user how to right click and save as
2. If your users are all IE 6 users, and your images are large enough,
explain that they should use the image toolbar that appears in the
upper-left corner of the image
3. Zip your images so that the browser treats the files as an unrecognized
type. It will prompt the user to Open or Save. Explain to the user they
need to save, and this will invoke a file-save dialog. Naturally, your
users will have to unzip them later.
4. For the thumbnails, use GIF/JPEG, for the download versions, use a
non-web image type, like TIFF. This has the same behavior as the Zip
approach, but may be easier for them to open once it has been saved.

There may also be a javascript approach to invoking a save dialog; you might
try posting to a javascript newsgroup.
 
Mike said:
can i open the save file dialog box from a asp.net web page?

thx

In your aspx file (that gives the contents to be stored), add
Response.AppendHeader("Content-disposition", "attachment");

you can also use
Response.AppendHeader("Content-disposition", "attachment; filename=thefile.ext");
to *suggest* a filename (*not* directory!) to store the file under.

Hans Kesting
 
Back
Top