ポスト

Import File


Imports a file to the Media Manager using an external url.

Returns information about the imported file. Use the parentFolderId そして filePath parameters to specify which folder you want the file to be imported to. If no folder is specified, the file is imported to the media-root folder.

注釈

  • について media property isn't returned in the files response object.
  • When you import a file, it's not immediately available, meaning you can't manage or use the file straight away. Learn more about knowing when a file is ready.

To import a file, you need to do one of the following:

  • Pass its MIME type in the mimeType field of the request. For example, mimeType: 'image/jpeg'.
  • Include its extension in either the displayName または url field of the request. For example, displayName: 'Example Image.jpeg または 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.

注: 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

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/site-media/v1/files/import

Event TriggersThis method triggers the following events:
役に立ちましたか?
はい
いいえ