Extension Auto-Installer, Wget replacement
Posted: Mon Apr 29, 2013 4:47 am
Hi,
I would like to send a file to Extension Auto-Installer, but not from wget, but from my nodejs script. As you may know, there are a tone of modules for nodejs that replicate the POST behavior. See for instance,
https://github.com/mikeal/request
https://github.com/timoxley/file-uploader
Unfortunately I couldn't make them work, here is a sample nodejs application,
I am getting this error,
Any idea how to solve this? I think it is very useful to eliminate wget usage, especially for windows users.
I would like to send a file to Extension Auto-Installer, but not from wget, but from my nodejs script. As you may know, there are a tone of modules for nodejs that replicate the POST behavior. See for instance,
https://github.com/mikeal/request
https://github.com/timoxley/file-uploader
Unfortunately I couldn't make them work, here is a sample nodejs application,
Code: Select all
var request = require('request');
var path = require('path');
var fs = require('fs');
var filepath = path.join(__dirname, 'myextension.xpi'); //path to xpi file
fs.createReadStream(filepath, {encoding: null}).pipe(request.post('http://localhost:8888'))
Code: Select all
Warning: WARN addons.xpi: Download failed: [Exception... "Component returned failure code: 0x8052000b (NS_ERROR_FILE_CORRUPTED) [nsIZipReader.open]" nsresult: "0x8052000b (NS_ERROR_FILE_CORRUPTED)" location: "JS frame :: resource://gre/modules/XPIProvider.jsm :: AI_loadManifest :: line 4555" data: no]
Source file: resource://gre/modules/XPIProvider.jsm
Line: 4555