Re: Unable to access files outside Webapp directory in tomcat
Hi, Initially, I was accessing the files using the absolute path, but this way I'm unable to download the files through my web Page (the download image on the page would require a relative path as src.) So, eventually, I haven't been able to try anything. Akash Christopher Schultz-2 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Akash, On 8/30/2009 12:34 PM, asingla4 wrote: I have kept all the documents and images outside the root directory of the application. How can I access these files in my application[?] What have you already tried? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEUEARECAAYFAkqb848ACgkQ9CaO5/Lv0PDYKQCVFFj6UJlSTTEFn0qemuv5J3R0 3gCggNJlZP3lGSIgZ+syit2FrKcV/88= =yW0Z -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- View this message in context: http://www.nabble.com/Unable-to-access-files-outside-Webapp-directory-in-tomcat-tp25213157p25244051.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Unable to access files outside Webapp directory in tomcat
Hi, I have my Web application installed in C:\Tomcat\webapp\ROOT. Now, through the Web page of this application, the user uploads an image which the application saves in C:\files folder using ImageIO class of JAVA. Now as soon as the file is uploaded, there should be a download button enabled for this uploaded image. If the user hits download, he should be able to download the file he uploaded. I'm done with saving the file to C:\files but I don't know how to make it downloadable when the download button is clicked because the files folder is outside the webapp directory. I hope this explains my issue. Thanks Akash. Christopher Schultz-2 wrote: Are you trying to read a file off the disk using something like FileInputStream, or are you trying to access a file from the server using a URL from a browser? These are very basic questions whose answers will certainly help solve your problem. -- View this message in context: http://www.nabble.com/Unable-to-access-files-outside-Webapp-directory-in-tomcat-tp25213157p25251880.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Unable to view uploaded files in Tomcat till server is refreshed
Hi All, I am building an application wherein the user would have an option to upload files (can be documents or images) and once the files are uploaded the user should be able to download it. I am using Apache Tomcat 6.0 and JDK1.6. Every thing seems to be OK for the File Upload part but I have some questions in my mind for the File Download Part. Approach 1: Initially I tried to use the BLOB feature of the mysql Database to save the file as a Binary stream in the DB. However after googling it out I found out that there are serious performance issues with BLOB (The file size can be anywhere from 1 KB to 20 MB). Thus we have ruled out this approach. Approach 2: We decided to save the file path in the DB and save the file to the File System. For this, Initially we stored the files under the Root directory of the application but the Tomcat could not recognize the files until it was refreshed/restarted. This can’t be accepted for the realtime environment. One fix we found out for this was to create a new file directory under the web-apps folder of tomcat outside the root directory of the application and save the files in this directory. To make this work we added a new context to the tomcat configuration. Please suggest if this is the best approach to follow. Thanks Akash Singla http://www.TheDaedals.com -- View this message in context: http://www.nabble.com/Unable-to-view-uploaded-files-in-Tomcat-till-server-is-refreshed-tp25212993p25212993.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Unable to access files outside Webapp directory in tomcat
Hi All, I am developing a web application with JDK 1.6 and Tomcat 6.0. I have kept all the documents and images outside the root directory of the application. How can I access these files in my application. Please suggest Thanks Akash Singla TheDaedals.com -- View this message in context: http://www.nabble.com/Unable-to-access-files-outside-Webapp-directory-in-tomcat-tp25213157p25213157.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org