How to read .gp file from local disk #650
-
I worked my way thru the Tutorial (Web) which shows and plays https://www.alphatab.net/files/canon.gp just fine. I changed the tutorial code to read: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi there. alphaTab loads file via AJAX when using the file property. Any existing browser restrictions apply to load files. In short: You will need to run alphaTab within a proper webserver and then you can load files from this same domain (keyword CORS). Or you build something that allows users to select a file via file picker & drag+drop. There are many tutorials around how to load files after a user opened it via file picker: https://developer.mozilla.org/en-US/docs/Web/API/File/Using_files_from_web_applications Instead of the |
Beta Was this translation helpful? Give feedback.
Hi there.
It seems you're rather new to web development. Browsers have security mechanism in place which prevent loading files from local disk. Imagine if this would be allowed: any website could load files from your disk without you knowing.
alphaTab loads file via AJAX when using the file property. Any existing browser restrictions apply to load files.
In short: You will need to run alphaTab within a proper webserver and then you can load files from this same domain (keyword CORS). Or you build something that allows users to select a file via file picker & drag+drop. There are many tutorials around how to load files after a user opened it via file picker: https://developer.mozilla.org/e…