簡體   English   中英

如何將JavaScript文件變量上傳到服務器?

[英]How to upload a JavaScript file variable to a server?

我在Javascript中有一個變量,它是一個加密的上傳文件。 將變量上傳到Web服務器的最佳選擇是什么? 我嘗試了simpleUpload.js ,但似乎無法使encryptedFile.simpleUpload("upload.php")正常工作。 該文件有效,因為我可以下載並解密。 謝謝。

最好的選擇是使用ajax將其上傳到服務器

 $ajax({ type : "POST", url : "upload.php", data: "put the encrypted file here", success: function(response){ // what you want to happen after success is returned }, error : function(error){ // handle any error response here } }); 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM