Questions tagged [createobjecturl]

49 questions
0
votes
1 answer

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 = $('.photo'); console.log('js working'); const blobDiv…
Kogami997
  • 33
  • 5
0
votes
0 answers

Blob file not showing on Safari - angular 7

I have an application with symfony 5 in back and angular in front. The app was working fine a few years ago but now I have a problem on loading a file only on Safari. I think the createObject URL function no longer works on safari but I don't know…
oracle972
  • 77
  • 10
0
votes
0 answers

Is there a way to find out the total size limit for object urls in javascript?

For a high-performance web application I would like to cache the media (images, videos, audio files) via fetch(), blob() and createObjectURL(). This might be up to 1GB (!). What happens if this exceeds the available space? Is there a…
0
votes
0 answers

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.open(url, '_blank', 'noopener'); This is…
0
votes
2 answers

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 to do the maths for the image resolution in…
paulo77
  • 174
  • 14
0
votes
1 answer

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 before turning it into an image Url. Making it…
Mats Raemen
  • 1,781
  • 1
  • 28
  • 41
0
votes
1 answer

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 the pdf first to the local disk and then sends it…
fanThomas
  • 127
  • 2
  • 6
0
votes
1 answer

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 some reason don't render it. Is Chrome don't support object…
E1dar
  • 575
  • 1
  • 7
  • 15
0
votes
2 answers

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.navigator.msSaveOrOpenBlob = () => true; const…
0
votes
0 answers

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" }); const url = window.URL.createObjectURL(file); window.open(url,…
0
votes
0 answers

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 automatically. I’m not sure if the…
0
votes
1 answer

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 the window on which it was created. The URL runs…
Kraken
  • 101
  • 8
0
votes
1 answer

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 Here's my code let btn =…
0
votes
2 answers

How to use object url in audio src

I am making a audio player using
doobean
  • 1,929
  • 4
  • 19
  • 27
0
votes
1 answer

JavaScript - Check if Object URL has been used

I can create an object URL like this: let pixel = "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="; let data = atob(pixel); let buffer = new ArrayBuffer(data.length); let array =…
cbwi
  • 33
  • 1
  • 6