Closed jveldhuizen closed 9 years ago
I think this is a nice feature to add, but in the mean time you could use setResponseHeader
to achieve this. If you could share the actual header and header value you are using that would be great :)
I implemented it this morning in the CloudPortal with
headerName: 'Content-Disposition'
value: 'attachment; filename=' + $mda/Name
However, the implementation of the Mendix file request handler is a little bit more advanced:
Scala:
val fileNamePrefix = if (isIE7or8orChromeFrame) "filename=" else "filename*=UTF-8''" val urlEncodedFileName = URLEncoder.encode(fileName, "UTF-8").replace("+", "%20") s"$dispositionType; $fileNamePrefix$urlEncodedFileName"
For the CloudPortal MDA file names, this is not needed (I think), but for the RestServices module, maybe it is better to use filename*=UTF-8'' and URL encoding and the %20 step.
?
Van: Michel Weststrate notifications@github.com Verzonden: maandag 14 juli 2014 11:35 Aan: mendix/RestServices CC: Jonathan Veldhuizen Onderwerp: Re: [RestServices] Set file name of file output (#29)
I think this is a nice feature to add, but in the mean time you could use setResponseHeader to achieve this. If you could share the actual header and header value you are using that would be great :)
Reply to this email directly or view it on GitHubhttps://github.com/mendix/RestServices/issues/29#issuecomment-48881007.
If you download a file, you want to know the file name, via the Content-Disposition header.