I am new to Javascript and Firefox addon programming.

I am making an add-on with the Add-on SDK that logs some information about user browsing activities. I use the file API with some hard coded file names.

Now I want to analyze those log files on the server side but I don't want the user to go through the process of locating the files and uploading them manually. I want to provide a button to the user; onclicking which those files will be automatically uploaded to the server.

This automatic uploading functionality is quiet vital for the entire project since it is a study oriented project and it will be very hard to get data from the user if he'll have to upload it manually.

Actual file upload (via multipart/form-data) is rather complicated to achieve but since you are controlling the server side - why not accept a regular POST request where the file data is in one of the form fields? So your code sending data to the server could look like this:

var file = require("sdk/io/file");
var {Request} = require("sdk/request");

var params = {};

Request({