Questions tagged [data-uri]
A data URI is a URL whose scheme part is 'data:' and which directly represents a resource, rather than the location of a resource.
594
questions
1
vote
1
answer
58
views
React access <canvas/> ref of a child component
I'm trying to save canvas as PNG file on the press of a button.
This is my code for now: (this part is working)
const canvasRef01 = useRef(null);
const saveAsPng = () => {
const canvas = ...
1
vote
1
answer
38
views
Does JavaScript not work on data URI pages in WebKit?
On Chrome on Android, JavaScript on a data URI page consisting of the following HTML
<html>
<head>
</head>
<body>
<a href="javascript:alert('Hi.');">Say hi</...
0
votes
4
answers
145
views
Decode .jpeg image from string
In my JS script I'm receiving string with encoded image.jpeg. The image is created with OpenCV in C++:
cv::imencode(".jpeg", rgb_img, jpeg_data);
std::string jpeg_string(jpeg_data.begin(), ...
0
votes
1
answer
66
views
Function button to take a screenshot and download it as an image file
I'm trying to develop a button that simply takes a screenshot of the current tab and downloads it (this may seem useless, as we can take screenshots manually, but I plan to extend the button's ...
0
votes
1
answer
27
views
SVG gradient works as stand alone HTML but not when embeded in CSS [duplicate]
My SVG gradient works as isolated HTML, but doesn't work when embeded into CSS background attribute.
I want to embed SVG into my CSS so I can have some complicated backgrounds. I started with a basic ...
0
votes
1
answer
56
views
Is it possible to make a reversible atob from btoa?
Why can't btoa convert back a base64 string?
let b64 = "abc123"
console.log(btoa(atob(b64))); //abc12w==
What happened in the end of the string?
I store images in localStorage as DataURI ...
0
votes
0
answers
116
views
Certain iOS images fail to POST in Capacitor
Our Capacitor application involves uploading an image, so we use "@capacitor/camera" to prompt the user to choose an image from their gallery; this works perfectly fine in Android, but fails ...
1
vote
1
answer
76
views
How to treat long Data uri in codes
I use data URI, base64 to add images and videos to my games, but I found if I want to make a game with multiple videos it will be really bad code with more than 500 lines for each video, so is there ...
0
votes
0
answers
92
views
MongoParseError: Invalid scheme
I am working on connecting to a MongoDB Atlas database but continue to get this error:
MongoParseError: Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+...
2
votes
1
answer
307
views
Opening a computed document using window.open() and data: scheme
I have a webpage running in a browser that generates a computed HTML document, and I want to open that document in a new browser tab.
The simple and dirty method is to do this:
const w = window.open(''...
-1
votes
2
answers
448
views
Convert image from url into data uri in node.js
I have been looking for a JavaScript solution to converting an image from an external url to a data uri. I have installed multiple packages and tested multiple methods but have not been able to find ...
0
votes
0
answers
52
views
Loading PDF from base64 results in empty file url
Based on this answer I'm trying to open a PDF in the web view of my app.
private func handlePdf(url: String) {
// get the base64 encoded part of the url
let base64String: String = String(url....
0
votes
1
answer
59
views
Await doesnt wait till a variable is set in an sync function [duplicate]
I am trying to get dataURI for an image using ApexCharts.exec method, here is my code:
const getDataURI = async() => {
console.log('leftChartObj', leftChartObj) // gets the data required ...
1
vote
1
answer
205
views
Get DataURL from Blob with await
I have fetch results that I want to turn into a typed DataURL.
I want to use await in the mainline of my app, not callbacks.
3
votes
0
answers
2k
views
How do I encode a "raw" image import in Vite to Base64?
I have a JPG that I import in Vite like import data from "whatever.jpg?raw";. My goal is to encode the resulting raw JPEG string as a data URI like data:image/jpeg;base64,DATA. The JPEG is ...
1
vote
1
answer
201
views
File PDF not showing in iframe with javascript dataUri docoument.querySelector
I have a project to display pdf file data in iframe with dataUri, but it's not showing. Please help me
File Index.php
<iframe src="" id="iframe" ></iframe>
<input ...
0
votes
2
answers
887
views
How to extract data URL from image binary data received from WhatsApp API?
Requirement
I am using WhatsApp API to receive and send messages. Now, someone sent me an image and the response I am getting by API is in the form of binary data as shown in the screenshot below.
(...
0
votes
0
answers
27
views
Image to DataURI to Blob. Is this Stackoverflow answer deprecated or is my code wrong? [duplicate]
Im trying to convert an image to BLOB and based my code on this SO post:
Blob from DataURL?
I can't tell if my code is wrong or if there's something wrong with the code from the SO post. Somewhere ...
1
vote
1
answer
58
views
Messages between Master to Worker are not passed fully when using "Cluster Mode"
I am getting a VERY weird issue when working with cluster mode.
Running Express as my framework
Somehow while using express body parser during that time, the expected size > the received size ...
-1
votes
2
answers
116
views
How does one retrieve and collect base-64 data-urls from the files-property of a multiple file input type?
I am working on a front end project where I want to store only 2 images, previousImage and nextImage, and show them on a div called previousWeek and nextWeek respectively.
I am using
// retrieve file ...
1
vote
1
answer
724
views
PDFMake Base64 generates malformed document
I'm using PDFMake to generate some PDF reports on client side.
When I specify the definition for document and pass it to createPdf(DEFINITION_HERE) I get my PDF and it looks nice and shiny. But I'm ...
1
vote
1
answer
1k
views
Display pdf file over 2MB using embed element
I am making an application that brings up a preview of PDF files. Embedding with an embed element works well for small PDF files but fails for larger PDF files because of the size limits for data urls....
2
votes
1
answer
411
views
He does not allow me to send images with a size greater than 800kb
I created a flow in Power Automate for it sent scheduled mails from a Sharepoint list, the Sharepoint list contains columns such as Subject, Recipient, Hyperlink, Date and Time sent, and additional I ...
1
vote
0
answers
21
views
First stream freezes after seccond connection opens?
I'm constructing an application that allows multiple devices to stream their webcam, through the browser, to another device. Each streaming device takes a DataURL image from the webcam and sends it ...
1
vote
1
answer
337
views
Bootstrap-Table data-url receiving records but not showing data in MVC
When calling a method, GetEmployee in this example, it is correctly showing 2 records but with a dash instead of the data. I'm guessing it is a Json issue in the controller but have been unable to ...
1
vote
2
answers
206
views
Data URL web worker loses security context
I am creating a web worker using a data URL in a local html file. The file has a secure context but the worker does not. Specs say they should be the same. Have I messed up, is the spec wrong or ...
0
votes
1
answer
139
views
JavaScript small image on data url [duplicate]
I am trying to capture the users webcam and upload it to my backend. I found out how to generate a data url (e.g. data:image/jpeg;base64,/9j/4A...) from the webcam stream. But the data url is always ...
0
votes
1
answer
506
views
How to navigate to data URL?
I am making am making a data URL generator, and I am making the link to the generated data URL. Here is some sample code that links to a data URL.
<a href="data:image/svg+xml;base64,...
1
vote
1
answer
1k
views
Not allowed to navigate top frame to data URL
I am making a data URL generator, and the last part of this project is the "open in new tab" button. But when I clicked the "open in new tab" button, it opens about:blank. I looked ...
1
vote
0
answers
413
views
Injecting a script tag from a content script to an iframe with data URI src throws a 'web_accessible_resources' error even tho it's set correctly
I'm working on an extension that injects a piece of code into iframes.
I'm using manifest v3 and I have a content script that injects a script tag with my code into the iframes.
The issue comes when ...
0
votes
0
answers
237
views
CSS SVG background-image as data-uri: is there a way to access ids/classes in that SVG with 'external' CSS
I have a website / application that uses different color themes.
Those themes are provided in css-custom-properties:
like:
:root{
--main-color: red;
--lighht-color: gray;
--dark-color: brown;
...
2
votes
0
answers
469
views
Downloading file from dataUrl results in `null` text displayed on Chrome, when hovering the file's "download tile"
I'm using the following code to force-download a file (so browser doesn't decide to open it in a new tab):
const fetchFileAndConvertToDataURL = async (mediaUrl: string): Promise<string> => {
...
0
votes
0
answers
378
views
How to dynamically change SVG data URI as background image in REACT?
I have a container that has a background image pattern. This pattern is passed in as a data URI specifically because I needed to dynamically change the fill of pattern through a prop I pass in when ...
0
votes
1
answer
109
views
React - Trying to pass SVG fill color as a prop while using svg as data in background image property?
I wish to dynamically change the fill color of a svg pattern that I'm using as a background image property in a container. I am doing this through using the data uri and directly injecting the SVG ...
0
votes
0
answers
410
views
Font file data URL violates unsafe-inline content security policy
I'm trying to reference a font file saved as a data URL (trimmed below for readability).
<link type="text/css" rel="stylesheet" href="data:application/octet-stream;base64,...
0
votes
1
answer
283
views
SVG as Data URI doesn't render (no <image> tag)
I have the following svg:
<svg viewBox="0 0 16 16"
fill="transparent" stroke="black" stroke-width="2"
xmlns="http://www.w3.org/2000/svg" id="icon-tick"
style="width: 12px; height: ...
0
votes
1
answer
2k
views
Dynamically create and embed data URL in Angular
In my Angular application, I have the following invariable basic conditions:
The application dynamically loads a ZIP file from an external URL.
Within this ZIP file, there's a HTML file which is to ...
0
votes
1
answer
2k
views
Rendering React SVG Components as images (using DATA URI)
Hi to optimize my huge svg components I'm tryin to do something similiar to this tutorial: https://medium.com/@ians/rendering-svgs-as-images-directly-in-react-a26615c45770
, so far I've come up with ...
0
votes
1
answer
766
views
How can I remove the base64 header from a data URI with Go?
I want to remove a base64 header from a base64 data URI, for example given:
data:video/mp4;base64,TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz
I want to remove the ...
1
vote
1
answer
731
views
Load GLTF file that is not located in Public folder
I found a problem that I cannot load GLTF files into a scene if I cannot place them in the Public folder in my React application. For example, I have MyPVPanel.gltf, and I want to load it in react app ...
8
votes
1
answer
723
views
Is there a way to index the images generated by "Next/Image Component" in Google Image Search?
I am having issues with indexing the images that are optimized by the Next/Image component these images are in the public folder of my Next.js app.
I haven't seen any examples where any resource/URL ...
0
votes
2
answers
2k
views
React-easy-crop just returns a blob url
I am using react-easy-crop to allow users to modify their profile pictures after uploading. The problem I am experiencing is that after cropping, the image is returned in the form of a blob url like ...
1
vote
0
answers
872
views
cannot dynamic import from data-uri in jest
In the Node.js REPL I can dynamic import like this:
Welcome to Node.js v16.13.2.
Type ".help" for more information.
> let m = await import('data:text/javascript,export const x = 5;')
[...
0
votes
1
answer
334
views
Clear blob and data urls from browser
we currently have a web app based on NodeJS where data is gathered and its charts are presented as images using the plotlyJS. Below shown is one such code snippet which creates a chart of the data as ...
3
votes
1
answer
1k
views
Markdown: How to resize image defined with a base64 data uri
In markdown, I would like to embed a base64 image data uri.

Is there any way to resize the rendered image in markdown?
1
vote
0
answers
297
views
Do the Google Docs Embed Viewer or the Office Embed Viewer support BLOB or DATA URLs?
Talking about these:
https://docs.google.com/viewer?embedded=true&url=
https://view.officeapps.live.com/op/embed.aspx?src=
I want to show a .ppt or .pptx in an iframe but I don't use file URLs in ...
0
votes
1
answer
46
views
Data URIs -- is it possible to have multiple formats overlapping?
Let's say I had a background gif like this:
data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////...
0
votes
2
answers
128
views
Redirecting user to another link
I have two links (www.link1.com) and (www.link2.com), i want whenever a user clicks on link1, he'll be redirected to link2. This is easy to do, but what if I don't want full link2 url written anywhere ...
1
vote
0
answers
320
views
How to get redirected url in flutter which open app?
I define host URL in my Flutter app
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT&...
1
vote
0
answers
667
views
Create and download an UTF8 plain text file from JS (browser)
I'm stucking on a problem that I cannot understand.
I got an HTML page, declaring <meta charset="utf-8" />, attempting to create and download a text file, containing some UTF8 ...