The problem is simple, I don’t know if has a simple solution: I’m using JPA to persist images to a database. I’m also using Struts 2.
I wrote an action that take the image from the db and sand it to the client.
The problem is that in this way, when people try to download the image on their PC, they have to write a name for the file (default is something like image.action – always the same).
Thanks
Check out the Content-Disposition HTTP Header to specify the filename of the resource. For example:
You can add this to your
HttpServletResponselike so: