bulkImportFiles( )


Deprecated

This method has been replaced with com.wix.media.site_media.v1.FilesService.BulkImportFile, and will be removed on March 31, 2024.

Deprecated. This function has been replaced with bulkImportFile(), and will be removed on March 31, 2024.

The bulkImportFiles() function returns a Promise that resolves to an array of the imported files' descriptors.

Imports a bulk of files to the Media Manager using external urls.

Returns information about the imported files. Use the parentFolderId and filePath parameters to specify in which folder you want each file to be imported. If no folder is specified, the file is imported to the media-root folder.

Note: The media property isn't returned in the files response object.

To import files, you need to do one of the following for each file:

  • Pass its MIME type in the mimeType field of the request. For example, mimeType: 'image/jpeg'.
  • Include its extension in either the displayName or url field of the request. For example, displayName: 'Example Image.jpeg or url: https://www.example.com/image.jpeg.
  • Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.

    Note: If you want to validate the media type, pass the file's expected media type in the optional mediaType field of the request. For example, mediaType: 'IMAGE'.

Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
importFileRequestsArray<ImportFileRequest>Required

Information about the files to import.

Returns
Return Type:Promise<BulkImportFilesResponse>
Did this help?