Issue
- When using the Headless Batch Engine to import Object Entries with an attachment field using a file URL, following the documentation here, we see that it creates duplicate empty files.
Environment
- Liferay DXP Quarterly Releases
Resolution
-
The current documentation (at the time of writing the article) is misleading using an example of a document in documents and media.
http://localhost:8080/documents/d/guest/treepicIncorrect curl below:
curl -X "POST" "http://localhost:8080/o/c/imageObject?restrictFields=actions" \ -H "Content-Type: application/json" \ -u 'test@liferay.com:learn' \ -d { "picture": { "fileURL": "http://localhost:8080/documents/d/guest/treepic", "name": "tree.png" } } - The fileURL property is meant for adding the attachment from an external resource.
- The system fetches that file, upload it to Liferay and link it with the object entry.
- It is meant to make the process of document upload easier.
- If the document is already in the documents library, the way to go is use either the Id or the ERC to make the link.
- We are changing the misleading official documentation on this topic.