0

How does one handle image downloads in a mobi site - using jquery mobile and asp.net mvc 3 and have a requirement to allow a user to download wallpapers to their mobile.

Can you trigger a download or is best to simply simple the image to them and let them handle the saving?

Any input appreciated.

Samuel Goldenbaum
  • 18,391
  • 17
  • 66
  • 104

1 Answers1

1

Typically, you can force the download of content on standard browsers by setting headers

"Content-Disposition", "attachment; filename=\"LicenseAgreement.pdf\""

on the return. This SO shows how to return a PDF file but theoretically, you could do the same with an image.

How can I present a file for download from an MVC controller?

However, it is questionable if every browser that is supported by jquery mobile would even respect that and give any kind of a save prompt or just open the image in a new window. Give it a shot but test it on iOS, Android, WinPhone 7.5+, and (gagging) Blackberry 6+ and see what happens because they're probably going to all behave a little differently.

Were it me, I'd simply link directly to the image either on the current page or with a target="_blank" and let them save it however they usually save images.

Community
  • 1
  • 1
sgliser
  • 2,071
  • 12
  • 13