Ive added an upload funtion which is working fine except there is no progress indicator
I have this in my web.config
<handlers> <add name="dotless" path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler,dotless.Core" resourceType="File" preCondition="" /> <add name="IGUploadStatusHandler" path="IGUploadStatusHandler.ashx" verb="*" type="Infragistics.Web.Mvc.UploadStatusHandler" preCondition="integratedMode" /> </handlers>
and this in modules
<add name="IGUploadModule" type="Infragistics.Web.Mvc.UploadModule" preCondition="managedHandler" />
and this is the uploader definition in my page
@(Html.Infragistics().Upload() .ID("igUploadCompanylogo") .ControlId("igUploadCompanylogo") .AutoStartUpload(false) .Mode(UploadMode.Single) .ProgressUrl(Url.Content("~/IGUploadStatusHandler.ashx")) .AllowedExtensions(new List<string>() { "jpg", "png" }) .MaxFileSize(1024000) .Render() )
files are uploaded ok, but the progress bar never works. Am I supposed to have a copy of IGUploadStatusHandler.ashx in my site ? I dont have one and I have no idea where to get it from
Hello Mark,
Thank you for posting in our forum.
You don’t need to manually add the IGUploadStatusHandler.ashx to your website, it is managed by an HTTP handler that comes with the Infragistics.Web.MVC.dll.
Could you please check if your progressUrl is correct – try opening the Dev Tools network tab of your browser and see what you get as a response from the server - this article would give you more detailed explanation about the file status and error codes you could get:
http://help.infragistics.com/Help/Doc/jQuery/2013.2/CLR4.0/HTML/igUpload_Using_HTTP_Handler_and_Modules.html
Also event handlers could be attached on the client-side in order to monitor the upload process and could provide you some more information about the cause of the issue, like in this sample:
https://www.igniteui.com/file-upload/upload-progress-manager
You could also try ignoring the URL of the HTTP handler in your Global.asax file, in the Application_Start method, like this:
protected static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("IGUploadStatusHandler.ashx");
}
If none of these work, or you need any additional assistance - feel free to contact me.
Ok thanks for the reply. Ill give it a try. there was another question I was hoping you could answer. Does the uploader work asynchronously ? The examples provided all have synchronous handlers and i wanted the whole process to be async. If it does, could you provide a working example ? Im actually streaming to azure BLOB storgage so Im not using a file system and I aslo want to stream to blob storage in chunks because some of the upload files could be quite large.
The files are uploaded asynchronously to the server and the server events could be raised in any order - depending on the order in which the files get uploaded.
You could see a live igUpload sample along with some of the server code here:
https://www.igniteui.com/file-upload/aspnet-mvc-helper
This article might be helpful to you - it explains in-depth how to handle the uploads on the server – either as memory streams or as file streams:
https://www.igniteui.com/help/igupload-saving-files-as-stream
If you need any additional assistance, feel free to contact me.