Commons FileUpload, Hash and Commons IO

2 messages Options
Embed this post
Permalink
pedrofaundezgon@terra.es

Commons FileUpload, Hash and Commons IO

Reply Threaded More More options
Print post
Permalink
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én puedes acceder a tu correo Terra desde el móvil.

Infórmate pinchando aquí.





Martin Cooper-3

Re: Commons FileUpload, Hash and Commons IO

Reply Threaded More More options
Print post
Permalink
On Tue, Jun 30, 2009 at 12:17 PM, [hidden email] <
[hidden email]> 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én puedes acceder a tu correo Terra desde el
> móvil.
>
> Infórmate pinchando aquí.
>
>
>
>
>
>