I've got a javascript webscript that's used to download certain nodes. The webscript is of type "org.alfresco.repository.content.stream" and populates the model's contentNode property with the node that is downloaded, basically like this example: https://wiki.alfresco.com/wiki/3.0_Web_Scripts_Kinds#Available_Kinds_of_Web_Script
This all works except for the naming of the downloaded file as that's always named after the noderef of the contentNode and it's always extensionless.
Does anyone know how i can either tell it which name and extension to use?
I did look at the model's contentPath property as well, but no matter what i set that to it keep returning a FileNotFoundException.
I have never tried saving a content stream, but my guess is that the "Download" option on the doc library actions does exactly that so I would start looking for that code.
Thanks Bob, unfortunately I've not been able to get it to work in javascript so had to rewrite the web script as java-backed but then at least i can set the response headers accordingly.