You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Hervé Guidetti <he...@idbsoft.ch> on 2001/03/15 11:10:54 UTC

Upload Service and relative path

Hi,

I use the upload service.

My FileItem are sometimes null and it seems that the problem is because the
service can't store it temporarily.
If I set the services.TurbineUploadService.size.threshold=1048576 (=
size.max) every thing is OK.

With services.TurbineUploadService.size.threshold=32000, I tried to make
directories in TDK dir, in webapps but it is not working, item is always
null.

My question is the services.TurbineUploadService.repository in TR.props is
relative to where ?
Any idea about that ??

Thanks

Hervé


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


Re: Upload Service and relative path

Posted by Daniel Rall <dl...@collab.net>.
Rafal Krzewski <Ra...@e-point.pl> writes:

> Funny isn't it? The path that you can put in to the
> TurbineResources.props
> is not used at all. When I fix that, the directory will be relative to
> the
> webapp root if it is does not start with a slash. Otherwise, it will be
> used as-is (to allow usage of /tmp and the likes).

+1
-- 

Daniel Rall <dl...@collab.net>

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


Re: Upload Service and relative path

Posted by Rafal Krzewski <Ra...@e-point.pl>.
Rafal Krzewski wrote:

> When I fix that, the directory will be relative to
> the
> webapp root if it is does not start with a slash. Otherwise, it will be
> used as-is (to allow usage of /tmp and the likes).

Done. Please update your snapshot, build it and check if the files
appear
where you expect them. 

A side note -- it seems that the memory caching / temp files thing I put
into the upload service causes a lot more confusion that I could have
expected. I felt that it is natural for the application develper to
actualy read and process the uploaded file. Hence the InputStream 
approach in FileItem. No matter if the file is in the memory or on the
disk, you can get the InputStream and read it.
Now it looks like the usual use of the UploadService is just tossing
the file somewhere into the server's disk. If this is what you want,
set threshold to 0, getStoreLocation() and rename() it.

Rafal

--
Rafal Krzewski
Senior Internet Developer
mailto:Rafal.Krzewski@e-point.pl
+48 22 8534830 http://e-point.pl

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


Re: Upload Service and relative path

Posted by Rafal Krzewski <Ra...@e-point.pl>.
Hervé Guidetti wrote:

> My FileItem are sometimes null and it seems that the problem is because the
> service can't store it temporarily.
> If I set the services.TurbineUploadService.size.threshold=1048576 (=
> size.max) every thing is OK.
> 
> With services.TurbineUploadService.size.threshold=32000, I tried to make
> directories in TDK dir, in webapps but it is not working, item is always
> null.
> 
> My question is the services.TurbineUploadService.repository in TR.props is
> relative to where ?
> Any idea about that ??

Uh, you just discovered a bug in the UploadService that is so huge that
I'm
really shocked that it hasn't been spotted yet.
The answer is, the files are always created in 'the current directory'
of the servlet engine. Usually, this is the directory where the person
that launched the engine was in, while typing start.sh (or whatever).
Funny isn't it? The path that you can put in to the
TurbineResources.props
is not used at all. When I fix that, the directory will be relative to
the
webapp root if it is does not start with a slash. Otherwise, it will be
used as-is (to allow usage of /tmp and the likes).

I'll get to fixing that right away.

Thanks,
Rafal

--
Rafal Krzewski
Senior Internet Developer
mailto:Rafal.Krzewski@e-point.pl
+48 22 8534830 http://e-point.pl

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