I have the file location stored in the database , my file exist on that location , now I want to get that file and return it to the user. My file is not a jpg , nor pdf consider the extension as .abc.
How to return this file to the user so that user can download it , by firing the web service.
You can use the
LocationHTTP header for this. You can set the actual path as the location header and give back the response. It is then the responsibility of the client to redirect to that URL and download.If you want to return the contents yourself, set
Content-Typeasapplication/octet-streamand return the file contents. I assume your rest service URL would be something likehttp://abc/yourapp/files/<idOfYourFile>