Skip to content

File Upload Sample

New Discussion
Pete Sral
Pete Sral asked on Jul 21, 2021 5:47 PM

Trying to make a working example from the online documentation at https://www.igniteui.com/file-upload/aspnet-mvc-helper   I've run into some hiccups, maybe someone can help me get past it:

View: (Answer in comments).

.ProgressUrl(Url.Content("~/IGUploadStatusHandler.ashx"))

Is there a code sample for this .ashx file?

Controller:

UploadConfig.DeleteFile(sender, args);

Is there a code sample for UploadConfig?

Or is there a better place to look for working samples?

Reference: http://www.igniteui.com/…/aspnet-mvc-helper

Sign In to post a reply

Replies

  • 0
    Pete Sral
    Pete Sral answered on Jul 15, 2021 6:07 PM

    Re: .ProgressUrl(Url.Content("~/IGUploadStatusHandler.ashx"))
    Source: http://www.infragistics.com/…/example-of-iguploadstatushandler-ashx

    That url ( http://igniteui.com/IGUploadStatusHandler.ashx ) is handled by a HTTP handler that comes as part of the Infragistics.Web.MVC dll . In order to use it in your own application you would need to register that handler in your config file. For example:

    <httpHandlers>

             <add verb="GET" type="Infragistics.Web.Mvc.UploadStatusHandler"

                             path="IGUploadStatusHandler.ashx" />

        </httpHandlers>

    • 0
      Monika Kirkova
      Monika Kirkova answered on Jul 16, 2021 1:27 PM

      Hello Pete,

      As stated in your response, the IGUploadStatusHandler.ashx is registered in the Web.config file.

      <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>

      Additionally, in the Global.asax file the URL of the HTTP handler needs to be ignored:

      In Global.asax:

          protected static void RegisterRoutes(RouteCollection routes) 

          {

              routes.IgnoreRoute("IGUploadStatusHandler.ashx");

          }

      More information regarding adding igUpload in your project could be found in the following topic of our documentation.

      Below I am attaching a sample, demonstrating the described behavior. Please test it on your side and let me know if you need any further information regarding this matter.

      Regards,
      Monika Kirkova,
      Infragistics

      1325.igUploadMVC.zip

      • 0
        Pete Sral
        Pete Sral answered on Jul 16, 2021 5:24 PM

        Thanks, I found that answer shortly after posting (RTFM).  Thank you for pointing out the routing exclusion.  I missed that piece.

        The other part:

        Controller:

        UploadConfig.DeleteFile(sender, args);

        This is in the sample and appears to be a utility method that deletes the file if it exists? 

      • 0
        Monika Kirkova
        Monika Kirkova answered on Jul 21, 2021 1:33 PM

        Hello Pete,

        After investigating this further, I determined that UploadConfig is a custom class defined in our samples browser application. This class contains a DeleteFile method, in order to delete all uploaded files. This is the reason why UploadConfig class is not included in the product, and respectively it is not described in our documentation.

        Please let me know if you need any further information regarding this matter.

        Regards,
        Monika Kirkova,
        Infragistics

      • 0
        Pete Sral
        Pete Sral answered on Jul 21, 2021 5:47 PM

        Thanks, I deduced that same thing.  Thanks again for replying.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Pete Sral
Favorites
0
Replies
5
Created On
Jul 21, 2021
Last Post
4 years, 7 months ago

Suggested Discussions

Created by

Created on

Jul 21, 2021 5:47 PM

Last activity on

Jul 21, 2021 5:47 PM