Java Web Application on Tomcat - Displaying a File Uploaded by User
Posted
by
walnutmon
on Stack Overflow
See other posts from Stack Overflow
or by walnutmon
Published on 2011-01-07T14:52:05Z
Indexed on
2011/01/07
14:53 UTC
Read the original article
Hit count: 271
I need to display uploaded files on a web application, the flow is as follows
- User uploads file through web UI
- Validation on image
- Makes call to
imageRepository.store( uploadedImage, user.getSite() )
- The user wants the image displayed which adds
<img src="${anUploadedImage.getUrl()}"/>
but that is where I'm stuck, what can getUrl()
do? The simple solution is to put it someplace and let Apache serve the file, but then I can't use the application to ensure that one user isn't modifying the URL to view other users files, which in this case is important
© Stack Overflow or respective owner