Questions tagged [createobjecturl]

49 questions
16
votes
2 answers

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 picture is displayed. Overwriting the picture with…
Pimv_h
  • 380
  • 1
  • 3
  • 13
6
votes
1 answer

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://localhost:3000 Site A embeds site B in an…
6
votes
1 answer

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. The complete error is as follows: Failed to load…
user1763510
  • 1,070
  • 1
  • 15
  • 28
4
votes
0 answers

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 field. It creates a URL and revokes it 5 seconds later. const compress =…
4
votes
1 answer

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 encodeURIComponent, with the former being more popular…
gaspar
  • 898
  • 1
  • 13
  • 26
4
votes
0 answers

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 it from downloading or download using a custom…
Aarji George
  • 599
  • 4
  • 8
3
votes
1 answer

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 add affects using CSS. I was successfully able to…
ivyrose
  • 27
  • 2
3
votes
1 answer

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([typedArray.buffer], {type: mimeType})) } const bytes =…
Donghua Liu
  • 1,776
  • 2
  • 21
  • 30
3
votes
0 answers

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-Webpack: TypeError: URL.createObjectURL is not a…
2
votes
1 answer

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 the browser marks the site as insecure: What is required for that…
2
votes
0 answers

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).
kulls
  • 845
  • 2
  • 12
  • 37
2
votes
0 answers

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 to use Url.createObjectURL with axios. What I am…
redshift
  • 4,815
  • 13
  • 75
  • 138
2
votes
2 answers

Setting audio element source from blob

I have an audio control on my page that looks something like: This works and the mp3 gets loaded and played. However I need…
rcarrington
  • 1,485
  • 2
  • 12
  • 23
2
votes
1 answer

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' }); cleanup = () => { // Not 100% sure this is…
xdhmoore
  • 8,935
  • 11
  • 47
  • 90
2
votes
0 answers

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 file as "failed". Clicking on "retry" is successful. The same…
kossmoboleat
  • 1,841
  • 1
  • 19
  • 36
1
2 3 4