4

In my Javascript code, I'm trying to check on the blob URL created by an 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')

To be sure, the files[0] is being referenced correctly. When I do: alert(files[0]);

Safari tells me: [object File]

So I know I have a file object being correctly referenced to - what should be - a correct WebKit URL referencing function.

Any ideas?

2 Answers 2

2

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 Safaris.

Sign up to request clarification or add additional context in comments.

Comments

1

I suspect you're focussing on the wrong element of that line. I'd double-check that both window.webkitURL and window.webkitURL.createObjectURL really exist.

2 Comments

window.webkitURL is undefined in Safari (works in Chrome, however). Any ideas why?
Well, it's not a standard, so I wouldn't expect it to exist anywhere but in the browser that defines it (Chrome). You might try the earlier names that Chrome had for it, window.createBlobURL and window.createObjectURL, but I wouldn't put odds on it. Good luck,

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.