Upload only image file
1 posts in topic
Flat View  Flat View

Posted By:   suman_Seshadri
Posted On:   Wednesday, February 9, 2005 12:17 PM

I have an file upload code that uploads any type of file.I want it to upload only image files.So, how should I do it ? Do I have to write code to check or is it possible to set it as an attribute? Any help is appreciated.

I tried :

But this only gives an error .

I also tried

<%@ page language="java" contentType="image/gif" charset=utf-8" %>

but no luck

- Suman

Re: Upload only image file

Posted By:   zia_shaik  
Posted On:   Wednesday, February 9, 2005 12:51 PM

If you do the validation on the jsp, then you are breaking the rule for struts model. So, perform the this validation in validation.xml
About | Sitemap | Contact