'undefined' is not an object (evaluation "window.webkitURL.createObjectURL") in Safari

In my Javascript code, I am trying to check the blob URL generated by the uploaded image: alert(window.webkitURL.createObjectURL(files[0]));

In Safari, with this line, I get the error: TypeError: 'undefined' is not an object (evaluating 'window.webkitURL.createObjectURL')

Of course, the files [0] are referenced correctly. When I do: alert(files[0]);

Safari tells me: [object File]

So, I know that I have a file object that is correctly referenced - what should be - the correct link to the WebKit link.

Any ideas?

+4
source share
2 answers

webkitURL belongs to the File / Blob API, which is not yet supported in Safari (5.1.2) or mobile Safari (iOS 5.01).

ArrayBuffers are available in recent Safari.

+2
source

I suspect that you are focusing on the wrong element of this line. I would double check that both window.webkitURL and window.webkitURL.createObjectURL .

+1
source

All Articles