data-uri

Data URI for CSV file in firefox not putting .csv extension

≯℡__Kan透↙ 提交于 2019-12-09 18:03:13
问题 I have a "Download file" href defined in my javascript file as: $("#downloadTag").html("<a href=data:text/csv;charset=utf-8," + encodeURIComponent(data) + ">Download</a>"); In chrome it works as expected i.e. when I click on this download link it gives file name as "download.csv". However, in firefox, it puts some gibberish name like "puzdb.part". Could someone please point me what I am doing wrong? Thanks Edit: Here is the jsfiddle demo: http://jsfiddle.net/kLJz9/ Edit #2: I noticed that on

Data URI - how to create them in Java?

人走茶凉 提交于 2019-12-09 02:26:36
问题 I have just been told to send the thumbnail of an image using data URI. I have been searching it but all I found was that its basically a textual representation of a file and can be directly used in HTML. I could not really find how to make a data URI in Java. I have an input stream of a file. Can someone please shed some light on it and point me to a way to generate this? 回答1: E.G. for an image: ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ImageIO.write(image, "png", baos)

Any RFC 2397 Data URI Parser for Java?

半腔热情 提交于 2019-12-08 21:16:01
问题 dataurl := "data:" [ mediatype ] [ ";base64" ] "," data mediatype := [ type "/" subtype ] *( ";" parameter ) data := *urlchar parameter := attribute "=" value value := token / quoted-string According to these BNF from the RFCs, the comma that separates the data from the mime type can actually appear in both the mime type and the data, so there's no simple way (i.e. reg ex) to break the URI into parts. Thus a full parser is needed. I am wondering does any one know any data URI libraries in

Image with data uri src not loading in UIWebView

寵の児 提交于 2019-12-08 18:30:37
I have a simple image populated from a data uri that loads fine in MobileSafari, but when I load the same webpage in a UIWebView, it shows as a broken image: <img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxQSEhQUEhQUFBUUFBQUFBcVGBUUFhUVFRUWFhQUFBQYHSggGBolHBQUITEhJSkrLi4uFx8zODMsNygtLisBCgoKDg0OGhAQGiwkHx8sLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCw3NyssLC4rLP/AABEIAMEBBQMBIgACEQEDEQH/xAAcAAABBQEBAQAAAAAAAAAAAAABAAIDBAUGBwj/xAA8EAABBAAEBAIJAwIFBAMAAAABAAIDEQQSITEFQVFhBnETIjJCgZGhsfAUwdFS4QdDkqLxI2JyghUzU//EABkBAAMBAQEAAAAAAAAAAAAAAAABAwIEBf

Unescaped '#' characters in a data URI body deprecated; How to find in project?

女生的网名这么多〃 提交于 2019-12-08 15:51:35
问题 I'm getting this warning from Chrome in my Angular 2+ application. Ok, so how am I supposed to go about finding where this issue is occurring in my project with so many data URIs? Wait for it to fail, I suppose? Yikes. [Deprecation] Using unescaped '#' characters in a data URI body is deprecated and will be removed in M67, around May 2018. Please use '%23' instead. See https://www.chromestatus.com/features/5656049583390720 for more details. Seems like they should point to the source somehow.

Navigating to a Data URI in IE

社会主义新天地 提交于 2019-12-07 12:59:28
问题 I have this extremely simple HTML: <a download="red.png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="> Static </a> In Chrome or Firefox, it downloads red.png as expected. In IE, it navigates to an error page. See it on JSFiddle. Now, I know the download attribute is not supported in IE, and that's fine. I'd still expect it to navigate to the "file", allowing the user to save it. Instead, it's

Why do markers, patterns, and unicode characters display incorrectly in a svg data uri in google chrome?

为君一笑 提交于 2019-12-06 12:58:14
I am using google chrome version 24.0.1312.57 on Mac OS X 10.6.8. In Safari 5.1.7 the svg image looks like this: In Chrome it looks like this: Notice the markers are gone from the paths and the path that has a pattern now has a fill of black and the unicode character has an A behind it. This only happens if the image is a data uri in the address bar in google chrome. If I open the svg image up as a file in chrome it displays correctly. I've tried taking the line endings away and putting it in base64, but it doesn't seem to fix anything. Is this a bug with chrome or am I missing something? Here

Silent sound data uri?

孤街醉人 提交于 2019-12-06 09:23:30
问题 Does anyone know of a way to set a data uri to a valid silent sound? I'd be really curious to see if anything exists like that! Thank you. 回答1: A 0-second WAVE file: data:audio/wave;base64,UklGRjIAAABXQVZFZm10IBIAAAABAAEAQB8AAEAfAAABAAgAAABmYWN0BAAAAAAAAABkYXRhAAAAAA== 回答2: i love data uri s so i did this: http://doiop.com/silent[DOT]mp3 which points to http://tinyurl[DOT]com/silentmp3 which points to data:audio/x-wav;base64

decode QR code from data URI

孤街醉人 提交于 2019-12-06 08:43:01
问题 I try to decode a qr-code from a data uri: var dataUri = 'data:image/gif;base64,R0lGODdh9gD2AIAAAAAAAP///ywAAAAA9gD2AAAC...'; decodeQrCode(dataUri, cb); I already tried qrcode-decoder-js (example with mocha test) function decodeQrCode(dataUri, cb) { qrcode.callback = cb; qrcode.decode(dataUri); } // error decoding QR Code and qcode-decoder (example with mocha test) function decodeQrCode(dataUri, cb) { var qr = new QCodeDecoder(); var img = document.createElement('img'); img.setAttribute('src'

Navigating to a Data URI in IE

做~自己de王妃 提交于 2019-12-06 02:15:07
I have this extremely simple HTML: <a download="red.png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="> Static </a> In Chrome or Firefox, it downloads red.png as expected. In IE, it navigates to an error page. See it on JSFiddle . Now, I know the download attribute is not supported in IE, and that's fine. I'd still expect it to navigate to the "file", allowing the user to save it. Instead, it's navigating to an error page. Is there a way to get around this problem? The Data URI is generated