How do I detect which button was clicked on “save/

2020-03-31 02:35发布

问题:

I got a webpage where members can download different kind of files on. I wan't to get information about which files and how many times each member have downloaded. when the user want to download a file he get browser pop-up where he gets 3 choises: "Open", "save" and "Cancel".(file dialog box in browser). i want to update the download status only if open/save button is clicked

Is there a way to detect which button was clicked on "save/open/cancel" dialog?

回答1:

You can't know that. Some browsers even start the download before the user decides what to do with the file. But perhaps you can get your webserver to log if the download has been completed. That's probably the most reliable result you can get.



回答2:

There is no way to know which button was clicked.



回答3:

I dont think you can. The site just streams the file to the browser. What the user does with the file is not known by the website as there is no more server side interaction.



标签: c# asp.net