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
1175
Complete Walkthru
posted

Can I get a complete walk thru of how to get upload working?  I'm gone through entire online documentation and it is scattered.  There doesn't seem to be a troubleshooting area.  Here's what we have so far:

I've added this in the web config:

<appsettings> 
  <add value="~/Uploads" key="fileUploadPath" /> 
  <add value="100000000" key="maxFileSizeLimit" />
</appsettings>
<handlers> 
  <add type="Infragistics.Web.Mvc.UploadStatusHandler" name="IGUploadStatusHandler" precondition="integratedMode" verb="*" path="IGUploadStatusHandler.ashx" />
</handlers>

Future Suggestion: Possibly prefix the company name with the settings to prevent naming collisions. Such as "Infragistics:fileUploadPath".

I've added this in the global.asax:

    UploadProgressManager.Instance.AddFileUploadingEventHandler("igProductUpload", (s, e) =>
    {
                
    });

    UploadProgressManager.Instance.AddFinishedUploadEventHandler("igProductUpload", (s, e) =>
    {
                
    });

    UploadProgressManager.Instance.AddFinishingUploadEventHandler("igProductUpload", (s, e) =>
    {
                
    });

    UploadProgressManager.Instance.AddStartingUploadEventHandler("igProductUpload", (s, e) =>
    {
                
    });

No breakpoints ever fire.

I've added this in the client:

    $("#igProductUpload").igUpload({
        mode: "single"        
    });

Testing locally in a Visual Studio Development Server, I can select a file and click upload. The file looks like it uploads VERY FAST! But I don't see any fiddler logs nor do I see a file being upload to the BIN folder or do any of the events fire.

So what I am missing? How do I troubleshoot this further?

Parents
  • 29417
    Offline posted

    Hello Karthik, 

    Thank you for posting in our forum. 

    If you’re defining the upload in a MVC view I would advise you to define it via the MVC wrapper as opposed to directly defining in javascript, since the MVC wrapper adds some additional options like the ControlID property(http://help.infragistics.com/jQuery/2015.2/ui.igupload#options:controlId ) which relates the control’s requests with the server-side event handlers. So in order for your events to be hit with your current setup you should also specify the controlId option. It should be the same as the name you’ve passed when adding the event handler in  the global.asax file.

    For example, if the event handler is added in the following way:

      UploadProgressManager.Instance.AddStartingUploadEventHandler("upload1",

               new EventHandler<UploadStartingEventArgs>(igUpload_UploadStarting));

    The controlId should be also set to “upload1”:

      $("#igProductUpload").igUpload({

            mode: "single",

    controlId: “upload1”       

        });

    For details on the event handlers please refer to:

    http://www.igniteui.com/help/igupload-using-server-side-events-

     Also note that the actual handling of the upload is done via a HttModule, which should also be added in your web config file. Please refer to the following topic that covers the needed  settings in the web.config:

    http://www.igniteui.com/help/igupload-using-http-handler-and-modules

    Note that the settings differ depending on the IIS version on which the web site will be hosted. 

    The fileUploadPath configuration you’ve defined in the  appsettings specifies the path to the location where the uploaded files will be stored once they are uploaded. So with the current setup of:

    “<add value="~/Uploads" key="fileUploadPath" />”

    The file will be uploaded in a folder named “Uploads” located under the root directory of your application. 

    As a troubleshooting tip I suggest that you open the browser’s development tool’s Network and check whether the requests initiated by the igUpload are properly handled by the HttpModule. If there are any issues with it check the HttpModule’s settings in your web.config.

     Let me know if you have any questions or concerns. 

    Best Regards,

    Maya Kirova

    Infragistics, Inc.

    http://www.infragistics.com/support 

Reply Children