file dialog on win32 returns backslashes in the path #551

Gamadril opened this Issue Mar 18, 2013 · 1 comment


None yet

2 participants


The paths returned by the file dialog should contain forward slashes instead of backslashes. Otherwise they are interpreted as escape charactes. Therefore you cannot just replace them all manually in JS code.


<!DOCTYPE html>
    <input type="file" id="fileButton">
    <image id="image"/>
    <div id="imageCSS" style="width: 200px;height: 200px; background-size: 100% 100%;"></div>
        document.getElementById('fileButton').addEventListener('change', function(event) {
            var filePath =[0].path;
            document.getElementById('image').src = filePath; // works
            document.getElementById('imageCSS').style.backgroundImage = 'url(' + filePath + ')'; // error getting file
        }, false);

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

nwjs member

Please try the latest 0.13.0 release. It should be fixed.

@rogerwang rogerwang closed this Mar 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment