<input type='file'> 在 IE 可取得完整路徑,Firefox 僅回傳檔名(安全性限制)。
View 建立檔案輸入框與 <span id="filePath">,jQuery 監聽 change 事件:
$('#fileInput').change(function() {
$('#filePath').text($(this).val());
});
Controller 不需處理路徑,僅接收上傳檔案流(HttpPostedFileBase)。前端顯示路徑僅供使用者確認,實際上傳由瀏覽器自動處理檔案內容傳輸。