We are migrating an existing application to run under ASP.NET Core MVC. We want to use the Upload feature, but the assembly we currently use, Infragistics45.Web.jQuery.v16.2, only works when the IIS App Pool using .NET CLR Version v4.0. .NET Core requires that the App Pool be set to "No Managed Code". We've tried using the new Upload Middleware we've found described on various Infragistics websites but can't seem to get any of them to work. We are running the .NET Core with the full 4.6.2 Framework due to functionality we need that is not available in the .NET Core Standard.
Can anyone provide a detailed example of both configuration, server-side and client-side code examples, to help us achieve what we need to do. We want to continue using the client-side igniteUI JQuery to perform the Uploads, but we need the server-side to run under .Net Core using the full 4.6.2 Framework.
Hello,
Thank you for contacting Infragistics!
The dll you are using is specifically for ASP.NET and not MVC so you wouldn’t want to use that any more. Instead you would use the jQuery/Ignite UI version of the control which uses JavaScript for most of its functionality. For using the igUpload in JavaScript/MVC please see the following documentation and samples:
https://www.igniteui.com/help/igupload-using-http-handler-and-modules
https://www.igniteui.com/help/igupload-using-server-side-events
https://www.igniteui.com/file-upload/aspnet-mvc-helper
https://www.igniteui.com/file-upload/upload-progress-manager
To use ASP.NET Core MVC you would have to get the correct NuGet package, as .Net Core only supports 3rd party references through NuGet packages. You can see the following on getting NuGet packages setup:https://www.igniteui.com/help/using-ignite-ui-nuget-packages
We implemented what is described in the pages 'igupload-using-http-handler-and-modules' and 'using-ignite-ui-nugget-packages'. Since we already have the upload code working on the client-side, we did not implement any of the server-side code described by the other web pages.
Unfortunately, after issuing the igUpload command at the client, the calls to the server fail with 404 errors. We've used the same client-side code with the ASP.NET version of the server-side dll and everything works fine.
The following is what we have in the web.config.
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
<add name="IGUploadModule" type="Infragistics.Web.Mvc.UploadModule" preCondition="managedHandler" />
</modules>
<handlers>
<remove name="WebDAV" />
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
<add name="IGUploadStatusHandler" path="IGUploadStatusHandler.ashx" verb="*" type="Infragistics.Web.Mvc.UploadStatusHandler" preCondition="integratedMode" />
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"></aspNetCore>
<security>
<requestFiltering>
<!--OPTIONAL: Set the maximum request length. By default the request lenght is ~30 MB. More info: http://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits-->
<requestLimits maxAllowedContentLength="2097151000" />
</requestFiltering>
</security>
<customHeaders>
<add name="X-Frame-Options" value="ALLOW-FROM http://www.microsoft.com" />
<add name="X-Frame-Options" value="ALLOW-FROM http://www.google.com" />
</customHeaders>
</httpProtocol>-->
</system.webserver>
Our Dependencies include both NuGet packages IgniteUI and IgniteUI.MVC (version 16.2.20162.2040 for both).
The client-side script to perform the upload is as follows:
$("#ATigUpload1").igUpload({
mode: 'multiple',
multipleFiles: true,
autostartupload: true,
progressUrl: "/IGUploadStatusHandler.ashx",
uploadUrl: "/ig_fua34sf345sdf13sdf3454erdsf2345asd3425df5235d54df345.aspx",
maxSimultaneousFilesUploads: 2,
controlId: "serverID1",
fileUploading: function (evt, ui) { ... },
fileUploaded: function (evt, ui) { ... },
fileSelected: function (evt, ui) { ... },
fileSelecting: function (evt, ui) { ... },
onError: function (evt, ui) { ... },
fileUploadAborted: function (evt, ui) { ... }
});
Is it possible to get a solution (we use VS 2017) for .net core that just does an upload to we can see everything we need to have defined? It is difficult to read the various web sites listed above and know whether or not we're defining everything. Thank you.
Thank you for the update. What are the 404 errors you are getting? Are you getting any other console errors when running the page or trying to upload a file? Would you be able to attach the code you have so far?
I attempted to upload a full solution to demonstrate the issue, but your website kept giving me a 404 error.
I've uploaded to my Dropbox and provided a link. If you are unable to access, please provide another option to getting the file to you.
When creating the test solution, forgot the web.config. It is attached, but cannot get to run using IIS Express.
To get the app to run with the web.config, you must publish the app and run under IIS. The app pool must be set to Unmanaged since it is running .net core.
One thing I found to be odd. When I initially run the app under IIS Express, I had forgotten the to include the web.config file, and got the 404 error. When I included the web.config and ran the application under IIS I got the same error.
Hi hrwebb,
Mike P. is out of the office for a few days so I am assisting with this issue.
Please have a look at the following documentation that describes how to reference our .net Core NuGet packages. This page also provides additional information for setting up the handlers and module using .net Core.
https://www.igniteui.com/help/using-igniteui-controls-in-asp.net-core-1.0-project
Currently, you are referencing the non-Core assemblies and that is not going to work. Once you are referencing the dotnetcore1.0 package, you can use the instructions on the same page to set up the igUpload.
If you need anything else, please let us know.