Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
XML
This is my markup

<asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" Width="500px" AllowedFileTypes="xls"/>

When I run it, and upload xls files, the page gives no reaction.

But the same works fine for

<asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" Width="500px" AllowedFileTypes="png"/>

That is I am unable to upload xls,xlsx,doc,docx etc. But I am able to upload image and pdf files.

And I am able to upload xls,xlsx,doc,docx etc., if I give no AllowedFileTypes. That is

<asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" Width="500px"/>

I am unable to figure out what is happening.

Help me ASAP.

Thanks in advance,
Avinaash S
Posted
Updated 16-Jun-14 23:25pm
v3
Comments
Member 10889460 17-Jun-14 5:20am    
It works fine for docx files if I use the following markup

<asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" Width="500px" AllowedFileTypes="doc,vnd.openxmlformats-officedocument.wordprocessingml.document" />

Thanks
Avinaash S
Member 10889460 17-Jun-14 5:36am    
And the following works for xlsx

<asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" Width="500px" AllowedFileTypes="xls,vnd.openxmlformats-officedocument.spreadsheetml.sheet" />

And the following for doc files

<asp:AjaxFileUpload ID="AjaxFileUpload2" runat="server" Width="500px" AllowedFileTypes="doc,msword" />

I used this page for reference
http://filext.com/faq/office-mime-types

Thanks
Avinaash S
Member 10889460 17-Jun-14 5:40am    
You can use it like this

<asp:AjaxFileUpload ID="AjaxFileUpload2" runat="server" Width="500px" AllowedFileTypes="xls,vnd.ms-excel,xls,vnd.openxmlformats-officedocument.spreadsheetml.sheet,doc,msword,doc,vnd.openxmlformats-officedocument.wordprocessingml.document" />

Thanks
Avinaash S

Hi All,

The issue got resolved.

I used this page for reference
Microsoft Office MIME Types

XML
It works fine for docx files if I use the following markup

<asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" Width="500px" AllowedFileTypes="doc,vnd.openxmlformats-officedocument.wordprocessingml.document" />


XML
And the following works for xlsx

<asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" Width="500px" AllowedFileTypes="xls,vnd.openxmlformats-officedocument.spreadsheetml.sheet" />

And the following for doc files

<asp:AjaxFileUpload ID="AjaxFileUpload2" runat="server" Width="500px" AllowedFileTypes="doc,msword" />


XML
You can use it like this

<asp:AjaxFileUpload ID="AjaxFileUpload2" runat="server" Width="500px" AllowedFileTypes="xls,vnd.ms-excel,xls,vnd.openxmlformats-officedocument.spreadsheetml.sheet,doc,msword,doc,vnd.openxmlformats-officedocument.wordprocessingml.document" />


Hope this will help some one :)
Thanks and regards
Avinaash S
 
Share this answer
 
v2
Comments
Member 10889460 17-Jun-14 6:31am    
The same way you can use

wmv,x-ms-wmv

for wmv

Thanks
Avinaash S
Member 10889460 17-Jun-14 6:37am    
Even this link was helpful

MIME Types by File Extension

This link contains lot of MIME Types by File Extensions
Quote:
inorder to work on IE Broswer docx and xlsx extension also needs to be added on AllowedFileTypes
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900