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: www.igniteui.com/.../aspnet-mvc-helper
Re: .ProgressUrl(Url.Content("~/IGUploadStatusHandler.ashx"))Source: 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>
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
Thanks, I found that answer shortly after posting (RTFM). Thank you for pointing out the routing exclusion. I missed that piece.
The other part:
This is in the sample and appears to be a utility method that deletes the file if it exists?
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.
Thanks, I deduced that same thing. Thanks again for replying.