0

I have setup a ajaxToolkit:AjaxFileUpload control and this works like a charm when uploading image files but when selecting a MOV file it fails with following error

[Exception: File extension is not allowed.] AjaxControlToolkit.AjaxFileUploadHelper.Process(HttpContext context) +604 AjaxControlToolkit.AjaxFileUploadHandler.ProcessRequest(HttpContext context) +180 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +812 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +132 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +73

The URL that is called when uploading is as follows

http://localhost:59486/AjaxFileUploadHandler.axd?contextKey={DA8BEDC8-B952-4d5d-8CC2-59FE922E2923}&controlID=ContentPlaceHolder1_AjaxFileUpload1&fileId=5F30E222-9559-18CF-EFEB-3B1A29EE91B5&fileName=IMG_3946.MOV&chunked=true&firstChunk=true

the URL that is called when uploading a jpg is as follows and this works

http://localhost:59486/AjaxFileUploadHandler.axd?contextKey={DA8BEDC8-B952-4d5d-8CC2-59FE922E2923}&controlID=ContentPlaceHolder1_AjaxFileUpload1&fileId=A58166B8-1515-FBB6-5474-600038099117&fileName=Kauslunde%20Fodbold%20-%20Oldboys.jpg&chunked=true&firstChunk=true

How to fix this issue? If I change the .mov file to .mov.jpg I can upload the file with no problem. So how do I tell that MOV files should be allowed?

The markup is as follows

<ajaxToolkit:AjaxFileUpload ID="AjaxFileUpload1" OnUploadComplete="AjaxFileUpload1_UploadComplete" runat="server" ValidateRequestMode="Disabled" ChunkSize="100" />  

2 Answers2

3

The solution is to add additionalUploadFileExtensions in web.config

 <configSections>
    <section name="ajaxControlToolkit" type="AjaxControlToolkit.AjaxControlToolkitConfigSection, AjaxControlToolkit" requirePermission="false"/>
  </configSections>
  <ajaxControlToolkit additionalUploadFileExtensions="mov" />
0

If the solution provided by Nikolaj Nørup Sostack does not resolve your problem, check if the Managed Pipeline Mode for your web application is set as Integrated (not Classic).

SHS
  • 149
  • 6