You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "pedrofaundezgon@terra.es" <pe...@terra.es> on 2009/06/30 21:17:53 UTC

Commons FileUpload, Hash and Commons IO

Is it possible easily upload a file, from a browser, using Commons FileUpload hashing it using a message digest and coping it to the filesystem using Commons IO in a single (or simple) operation?





Ahora tambi&eacute;n puedes acceder a tu correo Terra desde el m&oacute;vil.

Inf&oacute;rmate pinchando aqu&iacute;.






Re: Commons FileUpload, Hash and Commons IO

Posted by Martin Cooper <ma...@apache.org>.
On Tue, Jun 30, 2009 at 12:17 PM, pedrofaundezgon@terra.es <
pedrofaundezgon@terra.es> wrote:

> Is it possible easily upload a file, from a browser, using Commons
> FileUpload hashing it using a message digest and coping it to the filesystem
> using Commons IO in a single (or simple) operation?


You kind of answered your own question. Single, no, but simple, yes:

1) Handle the uploaded file with Commons FileUpload in the usual way.
2) Calculate a digest using something like Commons Codec's
DigestUtils.md5().
3) Copy the file using something like Commons IO's IOUtils.copy().

--
Martin Cooper



>
>
> Ahora tambi&eacute;n puedes acceder a tu correo Terra desde el
> m&oacute;vil.
>
> Inf&oacute;rmate pinchando aqu&iacute;.
>
>
>
>
>
>