51 questions
0
votes
0
answers
55
views
Displaying PDF files larger than 2MB stored in mysql database in iframe tag
I have an html page which displays a table of pdf files uploaded with columns saying who uploaded it, when it was uploaded, the size etc, plus a thumbnail of the first page of the pdf file. If you ...
0
votes
0
answers
682
views
Is URL.createObjectURL() a thin wrapper around a Blob, or does it hold its own copy of the buffer?
The URL.createObjectURL() function allows you to create a temporary URL from a Blob. I am aware that this function can leak memory (until the page is unloaded), so that it is often important to call ...
0
votes
1
answer
58
views
Material-UI: Chip component download option is not working, how to resolve the download issue?
I have uploaded the file using UI and I want to download after some time or instantly and I have implemented the same using <Chip> component but it not working, need help to resolve the same.
**...
0
votes
1
answer
1k
views
Unable to create image file using createObjectURL after upgrade to NextJS 13 from 10
I have a website that does the following:
On the client side, call an api endpoint passing just the URL of an image from the internet
On the server side, get the image by URL and return the image ...
0
votes
1
answer
1k
views
JS - displaying blob image result to a broken image icon
i get a broken image icon when i want to display a blob image with createObjectURL :
I provide a Uint8Array to the first parameter of the blob object (data), here is the js code :
const photo = $('....
1
vote
0
answers
37
views
Upload link render blank result - React & Flask send_file
I'm trying to download a file uploaded on S3. The file is well saved but impossible to download it. My result is a blank new tab. Any idea where the issue come ?
Here is the back end code :
try:
...
2
votes
0
answers
220
views
React: URL.revokeObjectURL() does not clear data when file changed
I create a image preview in React.
The preview image change every time input change:
const [src, setSrc] = useState('')
const [file, setFile] = useState()
useEffect(() => {
setSrc(URL....
3
votes
1
answer
13k
views
How to load a blob URL that's not marked as insecure?
If you go to the "creating a blob" example in https://developer.mozilla.org/en-US/docs/Web/API/Blob#creating_a_blob, you end up getting an URL that starts with "blob:https://", but ...
1
vote
0
answers
226
views
How can I send a list of videos from Node.js to React.js?
In my Node backend, I have an endpoint where I get a few videos from where I have them stored in Google Cloud, then return these videos as the response. Here is my code for that:
app.get("/...
7
votes
0
answers
675
views
URL.revokeObjectURL doesn't remove blobs from "Sources" panel and from chrome://blob-internals/
The problem is basically what the title says. The minimal example to demonstrate it is below.
This function accepts a File object as an argument from <input type='file' /> field. It creates a ...
1
vote
0
answers
2k
views
Inserting image url in quill only displays the image icon and not the image itself
I am using quill in Next.js and I have ran into a problem. Instead of using the default base64 encoding for images, I have added a custom handler that creates an object url for the images and I later ...
1
vote
1
answer
195
views
Generating PDF for downloading and opening it in new window
I want to create a PDF with
new File(["<body>text<body>"],"application/pdf")
But I want it without any libs
With Vanilla Js
And get base 64 string with new FileReader
...
1
vote
0
answers
633
views
Can I give a path in URL.createObjectURL?
I am opening a pdf in new tab using the below function:
const blob = new Blob([data.body], {
type: 'application/pdf'
});
let url = URL.createObjectURL(blob);
window....
0
votes
2
answers
1k
views
Get Original Image Width And Height From A New Image() Object - JavaScript
I have an image uploader where I have some PHP checks that happen on the server side. What I want to do is also provide frontend validations for the user, but I am having an issue getting the values ...
0
votes
1
answer
2k
views
javascript: SVG from file input to Blob to imageUrl returning weird results
I have a file input where the selected file has to be converted into an image url so I can add it to a canvas.
I have already found out that an SVG is an exception so I need to convert it into a Blob ...
0
votes
1
answer
761
views
Send a uint8array to browser
I am using the package hopding/pdf-lib from github within the browser to generate a pdf. I get the result as a uint8array. I can send this to the browser using rndme/download from github which stores ...
0
votes
1
answer
282
views
PDF is not showing inside object tag with object URL
I'm using object tag to display PDF inside it.
data for PDF looks like this "blob:http://localhost:4200/c91f1c30-0c97-45cc-a5f5-4897f3766f60".
Firefox can open and show document; Chrome for ...
0
votes
2
answers
2k
views
Why is my jest test failing for URL.createObjectURL?
I have two unit tests like so:
test('should call downloadPDFFile with msSaveOrOpenBlob when the navigator is present', async () => {
axios.get.mockResolvedValueOnce({ data: 'blob' });
window....
0
votes
0
answers
1k
views
How to change the url' name in URL.createObjectURL(file)?
I want to change the name that appears in the url when it is created, because it is not legible or identifying
const file = new File([blob],"name.pdf", { type:"application/pdf" });
...
1
vote
1
answer
1k
views
Svelte: how to create a Blob from `writable store`?
How can I use a "writable store" to create a "blob"?
I am new to Svelte.
I am trying to code a simple markdown editor for visually impaired users. The content of the "textarea&...
1
vote
0
answers
635
views
How To Prevent Download From Opening on Mobile Javascript/Vue
I have a Vue application that allows for a user to download a .pdf file. Currently, if a user clicks the file download button on a mobile device, it downloads and automatically opens. I'm wanting to ...
3
votes
1
answer
1k
views
Webcam Access for Custom Filters:vTypeError: URL.createObjectURL: Argument 1 is not valid for any of the 1-argument overloads
I am currently trying to improve my JS skills by going through WesBos's 30 Days of JavaScript. (It is really fun if!) I'm currently on Day 19, which is about using JS to access the WebCam, and then ...
0
votes
0
answers
61
views
Can I use input (file) to select a video AND load it’s corresponding json (with same root name)?
I have a project with two files:
example.mp4
example.json
These files are in the same path. I need to select only the example.mp4 file and automatically load the corresponding example.json file ...
0
votes
1
answer
2k
views
How to create a custom link to a uploaded local file object?
I Want to generate a link for my local woff file. With help of createobjectURL function, A link is created, however, the penalty is in the way of a blob. The URL lifetime is tied to the document in ...
3
votes
1
answer
370
views
Could not get the data in URL.createObjectURL
I am just curious about how to get the data wrapped in URL.createObjectURL.
So I write the following code.
function typedArrayToURL(typedArray, mimeType) {
return URL.createObjectURL(new Blob([...
0
votes
1
answer
642
views
JavaScript screen record is playing in video tag but not after downloading
I'm using JavaScript to record the user screen and afterward playing it in a video tag of the page and downloading it.
Now it's playing fine the browser video tag but not playing once it's downloaded
...
0
votes
2
answers
2k
views
How to use object url in audio src
I am making a audio player using
<audio src={audioSrc}>
tag.
When I get the audio file, it was a binary file(blob below) so I created a blob with it.
let test = new Blob(blob, {type: 'audio/mp3'...
2
votes
0
answers
386
views
URL.createObjectURL(blob) - Image src is not showing the Image
I have received the blob object as a response and It constructs the below Image tag using URL.createObjectURL(blob).
<image src="blob:http://localhost/someblobhax: />.
Unfortunately, the ...
1
vote
1
answer
543
views
getting error while rendering video by blob file by URL API
function startWebcam(){
navigator.mediaDevices.getUserMedia({video:true,audio:true}).then(localMediaStream=>{
//console.log(localMediaStream);
let textFileAsBlob = ...
6
votes
1
answer
6k
views
Why can't I fetch an object URL (aka "blob URL") cross-site and cross-frame?
I'm developing an iframeable component and have now stumbled over something that looks like a security problem.
I have two web sites:
site A, running at http://localhost:3002
site B, running at http:/...
1
vote
0
answers
887
views
Failed to execute 'createObjectURL' on 'URL
hey guys hope you are doing fine . I am new in react js and i am facing some difficulties to fix this error . TypeError: Failed to execute 'createObjectURL' on 'URL': Overload resolution failed. I ...
11
votes
1
answer
11k
views
Error loading Blob to img in Safari (WebKitBlobResource error 1.)
I am trying to save a blob to localforage and then retrieve it and display it. It works fine for a while, but after a couple of page refreshes or browser closes I get an error on some of the blobs. ...
1
vote
0
answers
667
views
Failed to execute 'createObjectURL' on 'URL': Overload resolution failed
I want to add an image upload feature to my website. If the image is uploaded I want it to be displayed in an IMG tag otherwise shows the first letter of the username. So to check whether the image is ...
1
vote
1
answer
1k
views
JavaScript - Check if Object URL has been used
I can create an object URL like this:
let pixel = "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
let data = atob(...
18
votes
3
answers
59k
views
TypeError: Failed to execute 'createObjectURL' on 'URL': Overload resolution failed
I am trying to have a file upload feature in my React application but am running into a problem. When I try to upload a first picture, it works just fine. The file explorer dialog closes and my ...
2
votes
0
answers
582
views
Axios and CreateObjectURL: Correct way to download blob data? My attempt causes page reload
I have a button with a click event handler that, when clicked, will use axios to GET a file that resides on a remote server (passes a token and gets a blob responseType back). I don't understand how ...
1
vote
0
answers
390
views
Fetch partial content (206) with Object URL
I have an API that returns video stream with partial content (206) support. But this API needs some custom headers like authentication, so I use fetch to get the stream and create object URL.
I've ...
2
votes
1
answer
393
views
Zip file is invalid from Flask send_fiile
I'm very new to JS code and just take over left work from colleague.
When Flask code return zip file using send_file, the JS side download seems invalid. Other format, like text and csv are good.
The ...
0
votes
1
answer
2k
views
image upload preview: window.URL.createObjectURL() only works once
I have an image uploader built from scratch in a React app. The image preview - made thanks to window.URL.createObjectURL() - only works the first time. I thought it was because of memory issue, so I ...
4
votes
2
answers
6k
views
Setting audio element source from blob
I have an audio control on my page that looks something like:
<audio id="myAudio" controls>
<source id="myAudioSource" src="https://my-site/mp3/123456" type=&...
2
votes
1
answer
1k
views
Play audio from ajax call using audio.srcObject and a MediaStream
I've implemented an HTTPS endpoint in php that returns mp3 data. Then, after an ajax call in javascript, I play it via the following:
let blob = new Blob([response.value], { type: 'audio/mp3' });
...
2
votes
0
answers
471
views
Downloading from object URL always fails the first time in Firefox
When opening an object URL in Firefox the file's content is correctly displayed (in the PDF viewer), but "Save page as..." cannot download the blob. The download list in Firefox lists the ...
-1
votes
1
answer
3k
views
Blob type open more than one file type like pdf and jpeg
I want to preview a file in another browser tab by clicking on a file which I uploaded before.
It's working fine with {type:'application/pdf'} or {type: 'image/jpeg'} but I need both of them.
Is there ...
2
votes
0
answers
819
views
Video Streaming: Using Blob URL, -Video Seek casting 404 file not found
I am a developer/creator of a Video Streaming Service, in order to server the movies I am using
createObjectURL() (BLOB URL).
The Blob Url is created and served to the html5 video element
...
3
votes
0
answers
973
views
Openlayers 6 TypeError: URL.createObjectURL is not a function
I have a question, after i update the openlayers from 5.3.1 to 6.3.1, when i run test, jest or mocha, both show the error "TypeError: URL.createObjectURL is not a function", what is the reason?
Mocha-...
6
votes
1
answer
6k
views
Creating and downloading text file from string in JavaScript: Blob/createObjectURL vs. encodeURIComponent
As I've been looking for a way to create and download a text file from a website with JavaScript, I've found a bunch of solutions but generally using either Blob/createObjectURL or otherwise ...
1
vote
1
answer
1k
views
Using URL.createObjectURL in Web Worker in IE11
I have to handle kind of large data sets with plain text. I get these data via a cloud as several chunks and use a web worker to process and format the data. In the end, I want to download it to the ...
0
votes
0
answers
630
views
In a Chrome Extension with Background and Content scripts when can I call revokeObjectURL?
I am uploading files from the local file system by using XMLHttpRequest. I am following the suggestion made in this SO question - Pass large blob or file from chrome extension
This is started in the ...
4
votes
0
answers
337
views
Custom name for blob URL file preview if downloaded
I am using blob to view a file(no specific type) in a new tab. If the file preview is supported, the file is view-able. However, if it is not supported the file gets downloaded. is it possible to stop ...
1
vote
1
answer
3k
views
createObjectURL: Type Error in Safari when using Blob
In HTML <video> object, I cannot play a video recorded by the video.js-record library. I checked the Blob returned in the player.recordedData variable and wanted to assign it to the object like ...