Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Update image title during upload?

Avatar

Level 4

We have users uploading images with spaces which we don't want considering SEO implications of spaces. what's the best approach to allowing users to upload an image with spaces but replacing spaces with "-" at rest?

5 Replies

Avatar

Level 10

Write a custom Servlet that will modify the asset name and use AssetManager API: 

http://scottsdigitalcommunity.blogspot.ca/2013/07/uploading-files-to-adobe-experience.html

Anytime you want to perform logic on an uploaded Asset - write a sling servlet. 

Avatar

Level 4

Scott

That's fine if I'm building new UI. We want to use OOB UI that is used by user to upload it but plug this step in between. Is there a way to do that?

Avatar

Level 9

Hi Chetan,

Pass the additional hidden parameter @TypeHint to control the node name generation [1].

[1]    http://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-pos...

Thanks,

Avatar

Level 4

Typehint updates the type but I want to be able to modify the file being uploaded before it's stored into the dam. My guess was if I update the Update Asset Workflow to include my own workflow step, i might work

Thoughts?

Avatar

Level 9

Hi Chetan,

      read the sling doc reference earlier on using typehint to change the filename uploded.  Or look into Out of the box rendition replace how it rename based on file name provided.     Update asset workflow will work but unnecessary adding burden to system also you need to handle an special workflow get stuck because you are changing the asset which is current payload.   I can just advise right way but choice is yours. 

Thanks,