Please validate on client side if file is uploaded and in serverside side
check for extension of file before checking application/octet-stream


if(file!=null){
                strFileName = file.getFileName();
                stContentType = file.getContentType();

 }

if ( strFileName != null && !strFileName.trim().equalsIgnoreCase("")) { //if
filename not null
 
strExtension=strFileName.substring(strFileName.lastIndexOf(".")+1);
strExtension=strExtension.toUpperCase();
if("application/octet-stream".equalsIgnoreCase(stContentType)
  ){
/////process///
}
}

Regards,
Raghuveer

-----Original Message-----
From: vijay shanker [mailto:[email protected]] 
Sent: Wednesday, November 04, 2009 10:56 PM
To: user
Subject: File upload: not identified content type.

Hello friends;

I am using commons file upload library to upload files. I have been noticing
some time my library does not get file content type correct. For such a file
it saves *application*/*octet*-*stream. *

Can any body describe how it does happens?

If some of you have known for such a situation. Please share the
information.
**
Regards,
Vijay Shanker Dubey
Ph: +91-9818311884


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to