This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Files upload problem with .dbf and .exe files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Files upload problem with .dbf and .exe files " Watch "Files upload problem with .dbf and .exe files " New topic
Author

Files upload problem with .dbf and .exe files

Arunav Dash
Greenhorn

Joined: Oct 04, 2007
Posts: 4
Hi ,
In my application i am using struts 2 .
I am trying to do a restricted file upload . And facing a problem with .dbf files upload .

In the interceptor stack i have used the following line .



For me .txt files and .csv files are working fine but .dbf(i.e Microsoft Visual FoxPro Table type ) files are not working .

The error is
Content-Type not allowed: upload "upload_abfbeb3_12033a3b84f__7f9e_00000002.tmp" application/octet-stream.

Please suggest me what should I put for the content type for .dbf .
If i add the application/octet-stream content type then it works , but at same time it allows .exe files also which i don't want . Please suggest me is there a specific content type for .dbf files or insome other ways also I can handel the issue .

With Regards
Arunabh
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Different clients return different mimetypes--there's no single way around the issue, AFAIK, but someone with more knowledge might help. This is more a browser issue, really.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Files upload problem with .dbf and .exe files
 
Similar Threads
Struts2 File Upload Maximum Size
Struts 2 FileUpload Interceptor Problem for Large File Size Upload....
how to validate the conent type in strut2.
Uploading DBF files problem
Struts 2 file upload tag type allowed error