wood burning stoves 2.0*
The moose likes Struts and the fly likes S:file tag restrict file types Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "S:file tag restrict file types" Watch "S:file tag restrict file types" New topic
Author

S:file tag restrict file types

Varun K. Gupta
Greenhorn

Joined: Jun 14, 2009
Posts: 10
Hi

I am using s:file struts2 tag to upload multiple files. I want to restrict file type to PDF or XML while clicking on browser button.

Accept attribute is not supported by major browser. Is there any way when browser button is clicked, the "Chose file to upload" popup contains only File of type as PDF only.. currently it is showing me All File[*]...

Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

when we click on choose file in the pop up box we have display *.pdf are you expecting this.


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Varun K. Gupta
Greenhorn

Joined: Jun 14, 2009
Posts: 10
yes Mohana, I am excepting only *.pdf it should not show me "All Files" or any other type in dropdown.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: S:file tag restrict file types
 
Similar Threads
How can i restrict the selecting file type to XML and TXT in file upload..
Restricting user to upload a CSV file
Restrict file type in Input type="File"
Struts2 multiple file upload using single file TAG
Define mime type for file upload