socketio-file-upload
Advanced tools
Comparing version 0.6.1 to 0.6.2
{ | ||
"name": "socketio-file-upload", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "Uploads files to a Node.JS server using Socket.IO", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -463,11 +463,8 @@ Socket.IO File Upload | ||
uploader.uploadValidator = function(event, callback){ | ||
fs.mkdtemp('/tmp/foo-', function(err, folder) { | ||
if (err) { | ||
callback( false ); // abort | ||
} | ||
else { | ||
uploader.dir = folder; | ||
callback( true ); // ready | ||
} | ||
}); | ||
// asynchronous operations allowed here; when done, | ||
if (/* success */) { | ||
callback(true); | ||
} else { | ||
callback(false); | ||
} | ||
}; | ||
@@ -518,2 +515,4 @@ ``` | ||
In this event, you can safely move the saved file to a new location. | ||
##### Event Properties | ||
@@ -520,0 +519,0 @@ |
@@ -197,2 +197,4 @@ /* | ||
_emitComplete(socket, data.id, fileInfo.success); | ||
_cleanupFile(data.id); | ||
// Emit the "saved" event to the server-side listeners | ||
@@ -202,4 +204,2 @@ self.emit("saved", { | ||
}); | ||
_emitComplete(socket, data.id, fileInfo.success); | ||
_cleanupFile(data.id); | ||
}); | ||
@@ -206,0 +206,0 @@ } |
61756
671