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) { ... }
});
The error message is:
504 Fiddler - Receive Failure.
ReadResponse() failed: The server did not return a complete response for this request. Server returned xxx bytes.
Running your sample the only error I see is: Request URL:http://localhost:52259/ig_fua34sf345sdf13sdf3454erdsf2345asd3425df5235d54df345.aspx?key=wps3nvdUrhTN54pT3uZu5TEccsObIM&cid=serverID1&multiple=true
However as you can see from the following forum thread this is expected:https://ko.infragistics.com/community/forums/p/62025/314488.aspx#314488
When you run your sample and upload a file does it get put in your Uploads folder?
If you need to increase the maxFileSizeLimit you can do so as follows in the ConfigureServcies:services.Configure<UploadAppSettings>(options => { options.maxFileSizeLimit = "220000000"; options.FileUploadPath = "~/Uploads"; });
When you test this open your browser’s dev tool (F12) and switch to the network tab before uploading the file and see what the network logs provide.
My error is not the same as listed in the forum ("can't find the resource"), but the file does appear to be uploaded and placed in the correct folder.
However, I also get the 504 error described in a previous post from the request, so the client never knows that the uploads were successful.
http://localhost:8082/IGUploadStatusHandler.ashx?key=870gKJxB8MGSpV94sIZdFyrVm1uMW2&command=status&_=1497021959851
The content of the IGUploadStatusHandler.ashx is below. The Infragististics.Web.UI.EditorControls is the reference we used to use. I'm tried changing this to several different values, like Infragistics.Web.MVC, but I always gets the error and the client never indicates that the file was successfully uploaded.
<%@ WebHandler Language="C#" class="IGUploadStatusHandler" %>
using System;using System.Collections.Generic;using System.Linq;using System.Web;using Infragistics.Web.UI.EditorControls;
/// <summary>/// Summary description for IGUploadStatusHandler/// </summary>public class IGUploadStatusHandler : UploadStatusHandler{
}
Can I get you to exclude the IGUploadStatusHandler from your project and setup your upload like the following:
$("#ATigUpload1").igUpload({ mode: 'multiple', labelUploadButton: "UPLOAD", multipleFiles: true, autostartupload: true, progressUrl: "~/IGUploadStatusHandler.ashx", maxSimultaneousFilesUploads: 2, controlId: "serverID1" });
The igUpload should setup the status handler and other handlers by itself. Do you get the 504 error after that is setup?
The change did not correct the problem. The same errors continue to occur.
Thank you for the update. Can you tell me more about your setup? What is your OS? What browser are you using? What version of the browser? Do you have a full network log of the traffic when that error occurs that you can attach?
I also found the following post which suggests the handler is not returning anything. I read the other post and changing the timeout didn't appear to fix the other persons problem. The file is getting uploaded (although with a 504 response). But the handler isn't returning what is expected.
http://www.telerik.com/forums/fiddler-readresponse()-failed-the-server-did-not-return-a-response-for-this-request-server-returned-0-bytes
We did get the ASP.NET code that supports an Upload to work with our app (even though we are running in a .net core environment, meaning we are using Kestrel). The call to the handler works fine in this case.
It is unclear why everything is working fine in your setup but not ours when using the MiddleWare. I would think it should be straightforward to configure and use, but that doesn't appear to be the case for us.
Thank you for the update. If you are getting the moderation message it is likely that you are posting many times in a short period of time so the system thought your post were spam. In the future it would be better to post all your updates in one response/post. Concerning the 594 error I have done some looking into and it appears it may be a timeout issue try increasing your timeout:
https://forums.asp.net/t/2081506.aspx?+Fiddler+ReadResponse+failed+The+server+did+not+return+a+complete+response+for+this+request+Server+returned+0+bytes+for+an+asp+net+application+
You may get several posts from me. Once I do a post I keep getting the message that the forum is managed and that my posts must first be approved. Other times it gets added automatically.
However, running the solution as sent also returns the 504 error.
I initially ran with the handler omitted from the published project and got the same 504 errors. So I put it in and it got the same error. Didn't seem to make any different one way or another.
I've been unable to get the app to run in IISExpress through VS 2017. It fails trying to find the web.config. It keeps trying to find it in c:\Users\mpeterson\Downloads\UploadTest\UploadTest\UploadTest. I can't find a reference to that anywhere, but I assume that is where you placed it for testing.
I can only run by publishing locally.