简体   繁体   中英

Save As Dialog Box C#

I have one export method which gives me one .txt file. That file is getting saved on Downloads on my machine.

I want one save as pop up which ask user where they want to save that downloaded file, as well as they can name the file.

I assume you mean the situation where the browser is automatically saving the file and not asking where to save it?

This is controlled by the Content-Disposition header (19.5.1). If you add a header like

Content-Disposition: attachment; filename="file.txt"

then the browser understands that it is an attachment and should ask what to do with it.

However, the browser may choose to do something else with it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM