grails - How to prevent file downloaded via response.outputStream to be saved on server? -
when downloading file via link in grails page, following controller working. however, somehow downloaded file saved in project structure web-app. right now, running in local host. when moved production, start saving file in server well. there way allow regular download client's machine prevent or clean download server?
file uploadedinbackendtobedownloadedfromfrontend = fetchthefilefrombackend() // custom method response.setheader("content-type", "application/octet-stream;") response.setheader("content-disposition", " uploadedinbackendtobedownloadedfromfrontend ; filename=\"${ uploadedinbackendtobedownloadedfromfrontend .name}\"") response.setheader("content-length", "$ uploadedinbackendtobedownloadedfromfrontend .size()}") response.outputstream << uploadedinbackendtobedownloadedfromfrontend .getbytes()
thanks lot!!
Comments
Post a Comment