Skip to content

Commit

Permalink
Fix file import for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nthouliss committed Oct 29, 2021
1 parent 928f6bd commit 720872a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pi/play_file_pi.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function sendSettings() {
if (file.value) {
// Keep encoded but replace slashes and add file protocol
const encodedPath = file.value.replace(/^C:\\fakepath\\/, "");
url = `file://${encodedPath.replace(/%2F/g, "/")}`;
url = `file://${encodedPath.replace(/(%2F)|(%5C)/g, "/").replace(/%3A/g, ":")}`;
// Set file info text
info.textContent = decodeURIComponent(encodedPath);
} else if (info.textContent) {
Expand Down

0 comments on commit 720872a

Please sign in to comment.