How to automatically send an article to the client.

xiaoxiao2021-03-06  21

In development, there is often this requirement, and the user is sent to the background after you click on a button. After some background operations, a dialog window that allows the user to download. Let the user choose to save or open.

In fact, this city's HTTTP protocol is scope, as long as the HTTP header sent to the client is sent to the client, it can be.

For ASP.NET & C #

Response.clear () ;::

Response.Appendheader ("Content-Disposition", "Attachment; FileName = filenameshowonclientdialog")

Response.write (ServerPhisicalFileName);

Response.end ();

转载请注明原文地址:https://www.9cbs.com/read-43665.html

New Post(0)