pixl-server-web 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/request.js +12 -0
- package/package.json +1 -1
package/lib/request.js
CHANGED
|
@@ -314,6 +314,18 @@ module.exports = class Request {
|
|
|
314
314
|
allowEmptyFiles: self.config.get('allow_empty_files') || false
|
|
315
315
|
});
|
|
316
316
|
|
|
317
|
+
form.onPart = function (part) {
|
|
318
|
+
// Only treat as file if it actually has a filename
|
|
319
|
+
if (!part.originalFilename) {
|
|
320
|
+
// Force it to be processed as a field
|
|
321
|
+
part.mimetype = null;
|
|
322
|
+
this._handlePart(part);
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
// Real file upload
|
|
326
|
+
this._handlePart(part);
|
|
327
|
+
}; // onPart
|
|
328
|
+
|
|
317
329
|
form.on('progress', function(bytesReceived, bytesExpected) {
|
|
318
330
|
self.logDebug(9, "Upload progress: " + bytesReceived + " of " + (bytesExpected || '(Unknown)') + " bytes", {
|
|
319
331
|
socket: request.socket._pixl_data.id
|
package/package.json
CHANGED