最佳答案
我认为你不能使用usuall http文件字段,因为他们期望一个本地路径.
您可以尝试使用AJAX上传.
您可以尝试使用AJAX上传.
@H_502_6@var req = null; var url = "savefile.PHP"; var data = "": // you have to check how to get the data from your saveAudio() method (window.XMLHttpRequest) ? req = new XMLHttpRequest() : (window.ActiveXObject) ? req = new ActiveXObject("Microsoft.XMLHTTP") : req = false; req.open(method,url,true); req.setRequestHeader("Content-Type","multipart/form-data"); if(data != null && data != "") { req.setRequestHeader("Content-length",data.length); req.send(data); }
您需要了解如何从saveAudio()函数获取filecontent并将其填充到数据变量中.
也许这也可以帮助你uploading files with ajax