You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by Murali Ramanathan <mr...@sapient.com> on 2008/07/23 18:28:39 UTC

Issue with File Upload.

Hi All,

We are facing an issue when uploading a file using  Apache commons file
upload.

User select a file from the local file system to upload. We need to
compare the last modified timestamp of the file with the one in the
database. And if the file being uploaded is newer than the last modified
time in the database, the file will be uploaded to DB. We are facing an
issue in terms of getting the last modified time of the file being
uploaded. Part of the code which is being invoked on form submission is
given below.

CommonsMultipartFile multiPartFile = (CommonsMultipartFile)
((MultipartHttpServletRequest) request).getFile("file");	

Is there any way to get the file metadata from the multipart http
request? Any help is really appreciated.


Thanks and Regards,
Murali Ramanathan | Sapient
Office: +91-80-41047000
Mobile: +91-97315-20520
Fax: +91-80-41047001
E-Mail: mramanathan@sapient.com
<BL...@sapient.com> 



Re: Issue with File Upload.

Posted by Mikhail Krivoshein <mi...@gmail.com>.
Hi Murali,

That is not issue with Apache commons file upload. HTTP doesn't
support concept of files, thus everything client sends to the server
is always considered to be new.

Best regards,
Mikhail Krivoshein

2008/7/23 Murali Ramanathan <mr...@sapient.com>:
>
> Hi All,
>
> We are facing an issue when uploading a file using  Apache commons file
> upload.
>
> User select a file from the local file system to upload. We need to
> compare the last modified timestamp of the file with the one in the
> database. And if the file being uploaded is newer than the last modified
> time in the database, the file will be uploaded to DB. We are facing an
> issue in terms of getting the last modified time of the file being
> uploaded. Part of the code which is being invoked on form submission is
> given below.
>
> CommonsMultipartFile multiPartFile = (CommonsMultipartFile)
> ((MultipartHttpServletRequest) request).getFile("file");
>
> Is there any way to get the file metadata from the multipart http
> request? Any help is really appreciated.
>
>
> Thanks and Regards,
> Murali Ramanathan | Sapient
> Office: +91-80-41047000
> Mobile: +91-97315-20520
> Fax: +91-80-41047001
> E-Mail: mramanathan@sapient.com
> <BL...@sapient.com>
>
>
>

Re: Issue with File Upload.

Posted by Jochen Wiedmann <jo...@gmail.com>.
On Wed, Jul 23, 2008 at 6:28 PM, Murali Ramanathan
<mr...@sapient.com> wrote:

> Is there any way to get the file metadata from the multipart http
> request? Any help is really appreciated.

No. The browser doesn't transmit the information.

Jochen

-- 
Look, that's why there's rules, understand? So that you think before
you break 'em.

 -- (Terry Pratchett, Thief of Time)