作者hidomi (hido米)
看板Ajax
標題[問題] jquery ajaxFileUpload問題
時間Mon Aug 25 18:03:02 2014
<input type="file" name="fileUpload" id="fileUpload"></input>
選擇檔案後,會顯示所選的檔名
但執行ajaxFileUpload 上傳成功之後,<input>所選擇的內容就被清空了@@
要如何保留原值?謝謝
$.get("123.jsp", {param:xxx} , function (data,textStatus){
$.ajaxFileUpload({
url:"upload.jsp",
secureuri: false,
fileElementId:'fileUpload',
dataType: 'text/xml',
success: function (data, status){
},
error: function (data, status, e){
}
});
});
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 42.75.223.77
※ 文章網址: http://webptt.com/m.aspx?n=bbs/Ajax/M.1408960989.A.260.html
1F:→ Ammenze: 這是瀏覽器本身的限制,安全性考量,所以一定會被清空 08/26 09:05
2F:→ mmis1000: 因為是用form做的,所以會被清掉,如果要不清 08/26 11:13
3F:→ mmis1000: 可能得用http request重寫一個 08/26 11:13
4F:→ mmis1000: xmlhttprequest 08/26 11:13