don't use "." (current folder) in web apps
better user servletcontext.getAttribute("javax.servlet.context.tempdir") and
use that as root folderif you need the uploads to be persistent (to be there after server restart) then create your own folder (e.g. /apps/myapp/image-uploads) On Fri, Feb 18, 2011 at 4:09 PM, Henrique Boregio <[email protected]>wrote: > Hi, I'm having trouble storing user uploaded images. > > In my WicketApplication class, I setup a folder to store users > pictures, so I end up with a folder structure similar to this: > ROOT FOLDER > - user1_folder (pic1.jpg, pic2.jpg, etc...) > - user2_folder ( ... ) > - ... > > The issue I am having is that this folder is created at > "src/main/java" (I am using maven). When I run the application, the > Root actually becomes the "webapp" folder, so the relative path > changes. > > How can I unify this folder so that its absolute path remains the same > no matter where it is called from? > > My current solutions is to hard-code it like: "/src/main/java" + > userFolderName, but that's no the best way I'm sure. > > Thanks! > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
