If you have used Document REST Services you most likely have realized that downloading any content from an object return a “document”/”response” + dot + file extension.
You can check William Zhou’s answer here:
This had been discussed in the initial implementation but hadn’t been implemented since Content-Disposition response header is neither mandatory nor handled by all HTTP clients. Besides, it has some overhead to map the format/mime to a filename extension. But I think it has values helping for the download experience. It is appreciated if you can file a feature request CR so that we can discuss this with the product manager.
I’ve alredy raised a SR to support in order to get OpenText to consider adding this “feature”.
However, if you can’t/don’t want to wait, just “extend” com.emc.documentum.rest.controller.ContentMediaController adding the following line to the getContent method just before returning the response:
headers.setContentDispositionFormData("attachment", (String)co.getAttributeByName("object_name"));
and you’re good to go.
Using object name as file name seems not to be a good idea – we constantly facing with following challenges:
* sometime customers want to generate object names according to other business data
* in many cases 255 bytes are not enough for file names – so, most our object names do not contain extension part
and I implemented following algorithm:
LikeLiked by 1 person