Assets Upload fails with an error message with bulk content

If an error occurs when uploading multiple assets to a folder, remove the 0-byte asset from the folder to allow the successful upload of the remaining assets. Follow the instructions provided here to resolve the issue.

Description description

Environment

  • Adobe Experience Manager as a Cloud Service
  • Adobe Experience Manager Assets

Issue/Symptoms

Uploading multiple assets to a folder throws the following error.

Resolution resolution

This failure can be caused by trying to upload a 0-byte asset as one of the conditions in the below function[ 0] was not met.

Look for any 0-byte files or the other conditions detailed in the following function.[ 0]

Once you remove the 0-byte asset from the containing folder the rest of the assets should be uploaded successfully.

The required conditions when uploading a file are having:

  1. fileName
  2. fileSize
  3. filePath
  4. blob

[ 0]

function ensureRequiredOptions(options) {
                if(!options.fileName || !options.fileSize || (!options.filePath && (!options.blob || !options.blob.slice))) {
                    throw new UploadError('UploadFile missing required fields. Must have fileName, fileSize, and either filePath or blob', ErrorCodes.INVALID_OPTIONS);
                    }
            }
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f