I have added a infragistics upload control to my view but I can't seem to get it to work. I followed the help and did all I can think off. I might have missed something easy, I don't know.
What happens is that when I open the partialview that contains the upload control, this all works. When I click the upload button I choose a file, in this case a jpg. I press OK and then I get the errors: The controller for path '/Documents/ig_fua34sf345sdf13sdf3454erdsf2345asd3425df5235d54df345.aspx' could not be found
And I also get the following javascript errors:
The resource cannot be found.
Requested URL: /Documents/ig_fua34sf345sdf13sdf3454erdsf2345asd3425df5235d54df345.aspx
Requested URL: /IGUploadStatusHandler.ashx
I have a _layout.cshtml class that contains all necessary references,
I've adjusted my Web.Config
Code:
<appSettings> <add key="fileUploadPath" value="~/Uploads" /> <add key="maxFileSizeLimit" value="100000000" /> </appSettings>
<httpHandlers> <add verb="GET" type="Infragistics.Web.Mvc.UploadStatusHandler" path="IGUploadStatusHandler.ashx" /> </httpHandlers> <httpModules> <add name="IGUploadModule" type="Infragistics.Web.Mvc.UploadModule" /> </httpModules>
The code in my partialview:
@(Html.Infragistics().Upload() .ID("igUpload1") .AutoStartUpload(true) .Mode(UploadMode.Single) .FileSizeMetric(UploadSizeMetric.MBytes) .Width("500") .LabelSummaryTemplate("Status: {0} out of {1} uploaded. ") .ProgressUrl("/IGUploadStatusHandler.ashx") .Render())
And in Global.asax.cs
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("IGUploadStatusHandler.ashx");
}
Any Ideas? Did I forget something, I'm guessing I still need to add some jquery in my partialview but I have no idea what exactly, I'm fairly new to all this.
I hope you can help
Greetings Ben
Ok, apparantly I had it configured for the wrong server, we use IIS7 while I thought it was 6. I still have a problem tough, I can't seem to find the files I upload and the statusbar doesn't show me any progress so I'm not sure it actually gets uploaded
Ok it is working except for the progressbar, is this normal?
Hello Ben,
Thank you for posting in our community.
I have attached a sample demonstrating how the upload component could be integrated within mvc project. In order to fire the method on the file upload event it is needed to add the following code the Application_Start() in Global.asax.cs method.
UploadProgressManager upm = UploadProgressManager.Instance;
upm.AddFinishedUploadEventHandler("igUpload1", this.OnFileFinished)
Please note that the first parameter of AddFinishedUploadEventHandler “igUpload1” corresponds to the ID and the ControlId properties of the Upload control from the vie
Hope this would help. If you need any further assistance feel free to contact me again.