You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Senthoorkumaran Punniamoorthy <so...@hotmail.com> on 2003/07/02 03:40:31 UTC

[fileupload] Problem with setting Repository

Hello,

I am using Tomcat as my servlet engine. Inside "webapps" folder I am using 
"fileupload" as context root for the file uploading application I am trying 
to write.

In the code

upload.setRepositoryPath("/repository");

and I have created the "repository" folder inside as a subfolder inside my 
context root "fileupload". But it throws an exception saying the folder not 
found. Can someone help me with this?

regards
Senthoor

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail


Re: [fileupload] Problem with setting Repository

Posted by Tom Maccariella <tm...@yahoo.com>.
You must specify an absolute path when using the setRepositoryPath() method.  Example:
 
   upload.setRepositoryPath("c:\\temp");
      - or -
   upload.setRepositoryPath("/tmp");
 
Keep in mind that the repository path is used as a place to temporarily store files that are larger than the configured size threshold.  So, no files will be permanently stored in the location you specify.  As such, you may want to simply point to a temporary directory on the server.
 
But if you still prefer to use a folder inside your application's context to store these temporary files, you can resolve the absolute path by using:
 
  upload.setRepositoryPath( context.getRealPath( "/repository" ) );
 
This should resolve to something like:
 
  c:\tomcat4.1\webapps\fileupload\repository
 
Hope this helps,
Tom

Senthoorkumaran Punniamoorthy <so...@hotmail.com> wrote:
Hello,

I am using Tomcat as my servlet engine. Inside "webapps" folder I am using 
"fileupload" as context root for the file uploading application I am trying 
to write.

In the code

upload.setRepositoryPath("/repository");

and I have created the "repository" folder inside as a subfolder inside my 
context root "fileupload". But it throws an exception saying the folder not 
found. Can someone help me with this?

regards
Senthoor

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org



 



---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!