You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to load from a URL I had to change how the binary was downloaded, instead of using blob I had to download as an arraybuffer and then convert to a blob. I'm not sure if this is caused by a recent change in Chrome.
var getFileBlob=function(e,t){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.addEventListener("load",function(){t(n.response)}),n.send()};
to
var getFileBlob=function(e,t){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="arraybuffer",n.addEventListener("load",function(){t(new Blob([n.response],{ type: "application/octet-stream" }))}),n.send()};
the files were hosted on a server with cors removed, here's how to do that in python
#!/usr/bin/env python3
from http.server import HTTPServer, SimpleHTTPRequestHandler, test
import sys
class CORSRequestHandler (SimpleHTTPRequestHandler):
def end_headers (self):
self.send_header('Access-Control-Allow-Origin', '*')
SimpleHTTPRequestHandler.end_headers(self)
if __name__ == '__main__':
test(CORSRequestHandler, HTTPServer, port=int(sys.argv[1]) if len(sys.argv) > 1 else 8000)
File loading from a URL could really use a overhaul and show progress
The text was updated successfully, but these errors were encountered:
In order to load from a URL I had to change how the binary was downloaded, instead of using blob I had to download as an arraybuffer and then convert to a blob. I'm not sure if this is caused by a recent change in Chrome.
to
the files were hosted on a server with cors removed, here's how to do that in python
File loading from a URL could really use a overhaul and show progress
The text was updated successfully, but these errors were encountered: