How media is imported
masterWhen importing media, the plugin supports several formats to identify or create files:
- By ID (
numberorobjectwithid): Searches the database for the existing media ID. - By Hash or Name (
objectwithhashorname): Searches the database for a match. - By URL (
objectwithurlorstring): If no match is found by ID, hash, or name, the plugin downloads the file from the provided URL.- Note: The server must have access to the URL.
- The
hashandnameare deduced from the URL. - You can provide extra metadata like
captionoralternativeTextwhen importing via URL.
Example Media Objects:
{ id: 1 }(By ID){ hash: "alpaga.jpg" }(By Hash){ url: "https://example.com/image.jpg" }(By URL){ id: 734, url: "http://localhost:1337/alpaga.jpg", name: "Alpacool", caption: "Alpacool In Da Hood" }(Full metadata)