How to get the file path from HTML input form in Firefox 3

前端 未结 8 1876
臣服心动
臣服心动 2020-11-22 02:12

We have simple HTML form with , like shown below:

8条回答
  •  春和景丽
    2020-11-22 02:19

    One extremely ugly way to resolve this is have the user manually type the directory into a text box, and add this back to the front of the file value in the JavaScript.

    Messy... but it depends on the level of user you are working with, and gets around the security issue.

    
        
        
        
    
    

    JavaScript

    var str = document.getElementById('file_path').value;
    var str = str + document.getElementById('file_name').value;
    

提交回复
热议问题