socketio-file-upload
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -0,0 +0,0 @@ /* |
@@ -0,0 +0,0 @@ /* Socket IO File Upload Client-Side Library |
{ | ||
"name": "socketio-file-upload", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Uploads files to a Node.JS server using Socket.IO", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -72,3 +72,3 @@ Socket.IO File Upload | ||
- [instance.maxFileSize = null](#instancemaxfilesize--null) | ||
- [instance.chunkSize = 100 KiB](#instancechunksize--100kib) | ||
- [instance.chunkSize = 100 KiB](#instancechunksize--100-kib) | ||
- [instance.useText = false](#instanceusetext--false) | ||
@@ -561,2 +561,8 @@ - [instance.useBuffer = true](#instanceusebuffer--true) | ||
// Do something on upload progress: | ||
siofu.addEventListener("progress", function(event){ | ||
var percent = event.bytesLoaded / event.file.size * 100; | ||
console.log("File is", percent.toFixed(2), "percent loaded"); | ||
}); | ||
// Do something when a file is uploaded: | ||
@@ -581,7 +587,11 @@ siofu.addEventListener("complete", function(event){ | ||
## Future Inovations | ||
## Future Work | ||
I hope to one day see this project implement the following features. | ||
First, I'm aware that this module currently lacks unit tests (mocha, etc). This is a problem that should be solved. I'm willing to accept PRs that add unit tests, or else one of these days when I have extra time I'll see if I can add them myself. | ||
* Upload Progress. There are examples of this on the net, so it should be feasible to implement. | ||
* Allow input of a file URL rather than uploading a file from your computer or mobile device. | ||
In addition, the following features would be useful for the module to support. | ||
1. Allow input of a file URL rather than uploading a file from your computer or mobile device. | ||
2. Have the server confirm receipt of a chunk before firing the "progress" event on the client side. | ||
As always PRs are welcome. |
@@ -159,3 +159,4 @@ /* | ||
_emitComplete(socket, data.id, fileInfo.success); | ||
throw err; | ||
console.log("SocketIOFileUploadServer Error (_uploadDone fs.utimes):"); | ||
console.log(err); | ||
} | ||
@@ -162,0 +163,0 @@ |
55423
882
595