如何獲得文件的完整路徑,而使用<input type=‘file’>
如何使用javascript,jquery-ajax獲取<input type ='file'>更改所選文件的完整路徑?
<input type="file" id="fileUpload">
<script type="text/javascript">
function getFilePath(){
$('input[type=file]').change(function() {
var filePath=$('#fileUpload').val();
});
}
</script>
選擇的文件,但文件路徑VAR包含所選文件的only name
,而不是full path
。
我在網上搜索它,但似乎出於安全原因,瀏覽器(FF,鉻)只是給文件的名稱。
是否有任何其他方式獲取選定文件的完整路徑?
一切必要的東西http://stackoverflow.com/questions/9463368/getting-file-full-path-when-uploading -file-in-html-in-firefox – Nauphal 2013-03-04 12:05:47
[查看此詳細信息](http://stackoverflow.com/questions/3489133/full-path-from-file-input-using-jquery#answer-3489167) – 2013-03-04 12:07:23
@ nauphal感謝您的評論,但有沒有其他方式獲得選定文件的完整路徑? – 2013-03-04 12:08:27