Summary: Support a way to provide a suggested filename for <img src="data:..."> file creation (drag to desktop, save as context menu). Test: <img src="data:image/png;base64,..."> Existing Behavior: • When dragging to Desktop => "Unknown.png" • Right click > Save Image as => "Unknown.png" Expected: Web authors should be able to provide a suggested filename. For example: <img src="data:image/png;base64,..." filename="dog.png"> Notes: • This is somewhat related to Chrome's non-standard "DownloadURL" support. However that is only for Drag and Drop (not Save as) and requires JavaScript so won't work in some contexts.
I'd like to propose a "filename" attribute on <img> for this purpose. Similar to the "download" attribute on <a> but because this doesn't affect behavior of the <img>; its just about a suggested filename.
<rdar://problem/32439969>
Created attachment 311409 [details] [PATCH] Proposed Fix
I opened an HTML Spec issue: <https://github.com/whatwg/html/issues/2722>