I have a minimal webpage in site-content/index.html with
<script type='module'>
import { openFile, draw } from 'https://root.cern/js/latest/modules/main.mjs';
let file = await openFile('example.root');
</script>
I have example.root in the same folder. It is 77MB. I have not problem to open it in ROOT. I get the following error
First block is 1024 bytes but browser does not provides access to header - try to read full file
Try to load very large file 80562913 at once - abort
Fail to load url example.root?stamp=1716326372479
Try to load very large file 80562913 at once - abort
Fail to load url example.root
Uncaught Error: Fail to read with several ranges
at XMLHttpRequest.read_callback (io.mjs:2830:31)
at XMLHttpRequest.<anonymous> (core.mjs:890:140)
at xhr.onreadystatechange (core.mjs:937:28)
at XMLHttpRequest.<anonymous> (io.mjs:2758:26)
I tried with different web server with the same results.
- livepreview from vscode
- python -m http.server 8080
- docker run -it --rm -p 8080:80 --name web -v ./site-content:/usr/share/nginx/html nginx
I tried with Google Chrome and Firefox. This is the log from nginx
172.17.0.1 - - [21/May/2024:21:23:32 +0000] "GET / HTTP/1.1" 200 425 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "-"
172.17.0.1 - - [21/May/2024:21:23:33 +0000] "GET /example.root?stamp=1716326613731 HTTP/1.1" 206 1024 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "-"
172.17.0.1 - - [21/May/2024:21:23:34 +0000] "GET /example.root?stamp=1716326613731 HTTP/1.1" 200 11442264 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "-"
172.17.0.1 - - [21/May/2024:21:23:34 +0000] "GET /example.root HTTP/1.1" 200 14498192 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "-"
curl -I http://localhost:8080/example.root
HTTP/1.1 200 OK
Server: nginx/1.25.5
Date: Tue, 21 May 2024 22:50:50 GMT
Content-Type: application/octet-stream
Content-Length: 80562913
Last-Modified: Tue, 21 May 2024 21:12:56 GMT
Connection: keep-alive
ETag: "664d0e58-4cd4ae1"
Accept-Ranges: bytes
curl -I -r 0-1023 http://localhost:8080/example.root
HTTP/1.1 206 Partial Content
Server: nginx/1.25.5
Date: Tue, 21 May 2024 22:54:27 GMT
Content-Type: application/octet-stream
Content-Length: 1024
Last-Modified: Tue, 21 May 2024 21:12:56 GMT
Connection: keep-alive
ETag: "664d0e58-4cd4ae1"
Content-Range: bytes 0-1023/80562913