You probably don't want to do this :)
SFS is for multiplayer functionality, not uploading images. I'd recommend initiating an upload script through a web server as apposed to SFS. In general, you want to keep as much processing power off of the SFS server, and uploading large packets of data is going to require heavier processing.
Is there a way to do it, yes, but using the JavaScript API makes it much harder (and slower). You'd have more luck with C#, Java, or even AS3.