• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 446
  • Last Modified:

How can I use the equivalent of "SaveFileDialog" in an asp.net web page?

Can someone please give me an example or idea of how I can accomplish this?

I have done this using Windows Forms as....

   SaveFileDialog saveFile = new SaveFileDialog();
                saveFile.Filter = "Text Files (*.txt)|*.txt|" + "All Files|";
                saveFile.DefaultExt = "txt";
                saveFile.Title = "Save My File As";
                saveFile.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);

                if (saveFile.ShowDialog() == DialogResult.OK)..................................

3 Solutions
käµfm³d 👽Commented:
Web pages do not have access to a client machine's local file system. You will be restricted to however the browser employed by your user decides to show a save file prompt.
you can do this by changing headers of the http context


check the url, if you describe the extension in header, it will force the same
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now