| |

VerySource

 Forgot password?
 Register
Search
View: 704|Reply: 2

Please help, how to click a button in ASP.NET, a "Save Picture As" dialog box pops up

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-6 15:00:01
| Show all posts |Read mode
That ’s it. In a webpage, I have an image. When I click a button, a "Save Image As" dialog box pops up. How do I write this in front-end javascript and how do I use it? If I use back-end code, how do I write it? Question It's more urgent, please help!
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 Unknown

Post time: 2020-1-6 16:09:01
| Show all posts
Response.Clear ();
         Response.ContentType = "application / octet-stream";
      
     
        Response.AddHeader ("content-disposition", "attachment; filename = aa.jpg");
        Response.WriteFile (Server.MapPath ("aa.jpg"));
        Response.End ();
Reply

Use magic Report

1

Threads

60

Posts

37.00

Credits

Newbie

Rank: 1

Credits
37.00

 China

Post time: 2020-1-6 16:24:01
| Show all posts
Upstairs solution, save the picture as a stream
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list