user818117
user818117

Reputation: 420

javascript download audio/mpeg content from different server with different origin

Is it possible to download audio/mpeg content from different server with different origin(like my server is www.a.com and the file is in www.b.com) with javascript on the browser. ps: like download and get 3rd byte of the file

Upvotes: 0

Views: 703

Answers (1)

Marc B
Marc B

Reputation: 360702

JS doesn't really have any file-based operators, and you'd be running up against the same-origin security policies. You might be able to get the browser to download it by inserting an <object> or similar tag into the DOM and have its source be the other server. But then you'd be stuck with a DOM object that wouldn't give you access to the raw bytes of the audio.

Upvotes: 1

Related Questions