Hi all
I have posted this on the github of the aem-upload library but would appreciate anyone here also can chime on this?
Views
Replies
Total Likes
Hi @kartheekd203042,
The issue you're encountering with the intermittent 404 error during asset uploads is likely related to timing or synchronization challenges when dynamically creating folders and immediately using them for uploads. This can happen if the folder creation process hasn't fully propagated or completed before the upload begins, even though you're checking for a 200 or 201 response.
To address this, I could recommend leveraging the Asset Folder Creator from the ACS Commons package. This tool is specifically designed to help quickly build complex Asset Folder hierarchies in AEM, ensuring that the folders are created efficiently and reliably before any assets are uploaded.
Views
Replies
Total Likes
Thanks @giuseppebag for the quick response.
Do note that this folder creation is happening from an Azure Function being managed by an external team. They are using the REST APIs to do all these operations and using the aem-upload library. I am not sure how ACS can help this use case unless we customize to expose this ACS tool via another custom API? Sorry if I understood it incorrectly but please feel free to chime in.
Views
Replies
Total Likes
hi @KARTHEEKDE2, If using the ACS tool isn't feasible, you can consider creating the necessary folder structure via API before executing the aem-upload command. This way, you can ensure that the folder hierarchy is fully established before initiating the upload process.
Here's an example of a curl command, which can easily be converted into JavaScript code for integration with the aem-upload process:
curl -u admin:admin \
-F":name=MyFolder" \
-F"jcr:primaryType=sling:Folder" \
http://localhost:4502/content/dam/folderName
Thanks for the response - the folders are created dynamically based on the new products created and they are using a similar command as above.
The aem upoad library recommended seems to have an issue so working with Adobe support on this as of now.
Views
Replies
Total Likes
Please keep us updated whenever you have the chance.
@kartheekd203042 Did you find the suggestions helpful? Please let us know if you need more information. If a response worked, kindly mark it as correct for posterity; alternatively, if you found a solution yourself, we’d appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
@kartheekd203042 Did you find the suggestions helpful? Please let us know if you need more information. If a response worked, kindly mark it as correct for posterity; alternatively, if you found a solution yourself, we’d appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
I am still working with Adobe on this @kautuk_sahni
Here is the update from Adobe:
As the DirectBinary does not create(not a bug) the folders and the documentation specifically says the folder must exist - see [1]. The logic to create folders is included in the higher level FileSystemUpload wrapper - see https://github.com/adobe/aem-upload/blob/master/src/filesystem-upload.js#L58. the DirectBinary type is the lowest level upload logic and does not include this kind of additional business logic. The customer should use the wrappers. If you want to create folders you need to use filesystem-upload wrappers.
We were using the logic since our assets are in Azure containers and DirectBinary was the only option -
Please find the ticket details below regarding the folder creation when using DirectBinary Approach. ASSETS-48959
We ended up creating the folders using the AEM REST API then invoke the library to upload assets into that folder.
Views
Replies
Total Likes
Views
Likes
Replies