Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
575
Trouble getting file upload to work
posted

I am creating an ASP .NET MVC 3 application. I followed this guide (http://help.infragistics.com/Help/NetAdvantage/jQuery/2011.1/CLR4.0/html/igUpload_Overview.html) and triple-checked that I had done everything as it said but I can't seem to get the upload to work.

The uploader renders correctly and I can click 'Upload File' and then select my file, but then I get an error telling me it can't find the resource because it is attempting go to the following URL:

Requested URL: /Import/ig_fua34sf345sdf13sdf3454erdsf2345asd3425df5235d54df345.aspx

Import is the name of my controller.  The rest of my code is as follows:

I have put in the handler code

    <system.webServer>
       <modules runAllManagedModulesForAllRequests="true">
      <add name="IGUploadModule" type="Infragistics.Web.Mvc.UploadModule"
                                   preCondition="managedHandler" />
    </modules>
    <handlers>
           <add name="IGUploadStatusHandler" path="IGUploadStatusHandler.ashx" verb="*"
             type="Infragistics.Web.Mvc.UploadStatusHandler" preCondition="integratedMode" />
    </handlers>
  </system.webServer>

and the route code

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("IGUploadStatusHandler.ashx");
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            ...
        }

and in my view

@(  Html.Infragistics().Upload()
    .ID("igUpload1")
    .AutoStartUpload(true)
    .ProgressUrl("/IGUploadStatusHandler.ashx")
    .Render()
)

What am I doing wrong?

Parents
  • 1800
    posted

    Hi danenatoli,

    When you click upload what is happening exactly - you are redirected to /Import/ig_fua34sf345sdf13sdf3454erdsf2345asd3425df5235d54df345.aspx? Or just you see this in Developer Tools/Firebug, etc? By the way you can check also these samples: http://samples.infragistics.com/jquery/file-upload/. In this section you can find some useful samples for fileupload and how to configure it in MVC.

    Thanks,

    Miro Hristov

Reply Children