modules/express.js
function (upload) {

						if (!upload || !upload.path || !upload.name || !upload.size) {
							LOG.error('upload object incomplete:', l_name);
							return;
						}

						// record basic file info
						var arr = upload.path.split('/');
						var upload_name = arr[arr.length-1];
						var filename = (preserve_name ? upload.name : upload_name); 
						LOG.warn("The file " + upload.name + " was uploaded as: " + filename + ". size: " + upload.size, l_name);
						uploaded.push({name: filename, size: upload.size, type: upload.type});						

						// check if we might need to re-name
						// default is to rename (preserve upload file names)
						if (preserve_name === false) {
							return;
						}

						var new_name = SR.path.resolve(form.uploadDir, upload.name);
						SR.fs.rename(upload.path, new_name, function (err) {
							if (err) {
								return LOG.error('rename fail: ' + new_name, l_name);
							}
							LOG.warn("File " + upload_name + " renamed as: " + upload.name + " . size: " + upload.size, l_name);							
						});
					}
function (upload) {

						if (!upload || !upload.path || !upload.name || !upload.size) {
							LOG.error('upload object incomplete:', l_name);
							return;
						}

						// record basic file info
						var arr = upload.path.split('/');
						var upload_name = arr[arr.length-1];
						var filename = (preserve_name ? upload.name : upload_name); 
						LOG.warn("The file " + upload.name + " was uploaded as: " + filename + ". size: " + upload.size, l_name);
						uploaded.push({name: filename, size: upload.size, type: upload.type});						

						// check if we might need to re-name
						// default is to rename (preserve upload file names)
						if (preserve_name === false) {
							return;
						}

						var new_name = SR.path.resolve(form.uploadDir, upload.name);
						SR.fs.rename(upload.path, new_name, function (err) {
							if (err) {
								return LOG.error('rename fail: ' + new_name, l_name);
							}
							LOG.warn("File " + upload_name + " renamed as: " + upload.name + " . size: " + upload.size, l_name);							
						});
					}
function ( upload ) { if ( ! upload || ! upload . path || ! upload . name || ! upload . size ) { LOG . error ( 'upload object incomplete:' , l_name ) ; return ; } // record basic file info var arr = upload . path . split ( '/' ) ; var upload_name = arr [ arr . length - 1 ] ; var filename = ( preserve_name ? upload . name : upload_name ) ; LOG . warn ( "The file " + upload . name + " was uploaded as: " + filename + ". size: " + upload . size , l_name ) ; uploaded . push ( { name : filename , size : upload . size , type : upload . type } ) ; // check if we might need to re-name // default is to rename (preserve upload file names) if ( preserve_name === false ) { return ; } var new_name = SR . path . resolve ( form . uploadDir , upload . name ) ; SR . fs . rename ( upload . path , new_name , function ( err ) { if ( err ) { return LOG . error ( 'rename fail: ' + new_name , l_name ) ; } LOG . warn ( "File " + upload_name + " renamed as: " + upload . name + " . size: " + upload . size , l_name ) ; } ) ; }
modify uploaded file to have original filename
modify uploaded file to have original filename