如何解析C:\fakepath?<input type="file" id="file-id" name="file_name" onchange="theimage();">這是我的上傳按鈕。<input type="text" name="file_path" id="file-path">這是我必須顯示文件的完整路徑的文本字段。function theimage(){
var filename = document.getElementById('file-id').value;
document.getElementById('file-path').value = filename;
alert(filename);}這就是解決我問(wèn)題的JavaScript。但警報(bào)值給了我C:\fakepath\test.csv莫茲拉告訴我:test.csv但我要當(dāng)?shù)氐耐耆薅ㄎ募窂?.如何解決這個(gè)問(wèn)題?如果這是由于瀏覽器安全問(wèn)題,那么應(yīng)該采取什么替代方式來(lái)做到這一點(diǎn)呢?
如何解析C:\fakepath?
慕桂英3389331
2019-06-10 16:34:47