function reportUploadSuccess(req, res, fileRevs) {
  const uploads = req.files.map((file, index) => ({
    originalName: file.originalname,
    uploadedFileName: file.filename,
    fileID: fileRevs[index].id,
    description: fileRevs[index].description,
    license: fileRevs[index].license,
    creator: fileRevs[index].creator,
    source: fileRevs[index].source
  }));
  res.status(200);
  res.type('json');
  res.send(JSON.stringify({
    message: 'Upload successful.',
    uploads,
    errors: []
  }, null, 2));
}
/**
 * Send a success response to the API request that contains the newly assigned
 * filenames, so they can be used, e.g. in the editor.
 *
 * @param {IncomingMessage} req
 *  Express request
 * @param {ServerResponse} res
 *  Express response
 * @param {File[]} fileRevs
 *  the saved file metadata revisions
 * @memberof APIUploadHandler
 */
Send a success response to the API request that contains the newly assigned
filenames, so they can be used, e.g. in the editor.

@param {IncomingMessage} req
Express request
@param {ServerResponse} res
Express response
@param {File[]} fileRevs
the saved file metadata revisions
@memberof APIUploadHandler
Send a success response to the API request that contains the newly assigned filenames so they can be used e . g . in the editor . @param { IncomingMessage } req Express request @param { ServerResponse } res Express response @param { File [] } fileRevs the saved file metadata revisions @memberof APIUploadHandler
function reportUploadSuccess(req, res, fileRevs) {
  const uploads = req.files.map((file, index) => ({
    originalName: file.originalname,
    uploadedFileName: file.filename,
    fileID: fileRevs[index].id,
    description: fileRevs[index].description,
    license: fileRevs[index].license,
    creator: fileRevs[index].creator,
    source: fileRevs[index].source
  }));
  res.status(200);
  res.type('json');
  res.send(JSON.stringify({
    message: 'Upload successful.',
    uploads,
    errors: []
  }, null, 2));
}
function reportUploadSuccess ( req , res , fileRevs ) { const uploads = req . files . map ( ( file , index ) => ( { originalName : file . originalname , uploadedFileName : file . filename , fileID : fileRevs [ index ] . id , description : fileRevs [ index ] . description , license : fileRevs [ index ] . license , creator : fileRevs [ index ] . creator , source : fileRevs [ index ] . source } ) ) ; res . status ( 200 ) ; res . type ( 'json' ) ; res . send ( JSON . stringify ( { message : 'Upload successful.' , uploads , errors : [ ] } , null , 2 ) ) ; }
Send a success response to the API request that contains the newly assigned
 filenames, so they can be used, e.g.
Send a success response to the API request that contains the newly assigned filenames so they can be used e . g .