Addons için yeni Firefox SDK'dan "İstek" sınıfını kullanarak bir sunucuya zip dosyası göndermek için arıyorum. Bu benim kodudur:Yeni SDK Firefox Ekleme kullanarak dosyaya dosya gönder Addon
var Request = require("sdk/request").Request;
var file = new FileUtils.File(pathToZipFile);
Request({
url: serverURL,
content: file,
onComplete: function (response) {
for (var headerName in response.headers) {
console.log(headerName + " : " + response.headers[headerName]);
}
console.log("Response " + response.text);
}
}).post();
Ama hatadır: nsresult:
[İstisna ... "0x80520009 (NS_ERROR_FILE_INVALID_PATH) [nsILocalFile.target] Bileşeni döndürülen hata kodu": "0x80520009 (NS_ERROR_FILE_INVALID_PATH "location:" JS frame :: resource: //gre/modules/commonjs/toolkit/loader.js -> kaynak: //gre/modules/commonjs/sdk/querystring.js :: stringify/< :: satır 70 "veri: hayır"
Bazı çekler yapmaya çalıştım:
- sunucu üzerinde ve zip dosyası mevcut olduğu dosyaların
- olmadan normal bir GET ve POST alır ve yol
Herhangi bir hata görüyor musunuz haklı? Çok teşekkürler