This is a migrated thread and some comments may be shown as answers.

Custom Http Handler

5 Answers 168 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Tony
Top achievements
Rank 1
Tony asked on 02 Mar 2013, 07:46 AM
Hello,

I'm using the custom http handler method for AsyncUpload and I need to pass some values to my .ashx handler with query string. When I upload a  2048KB or smaller file everything works fine. But if I try to upload anything more than 2048KB, all query string variables become NULL but the UploadedFile content is fine. My application is setup to upload 2GB file and I have no problem with the standard method. What can possible cause the query string variables to become NULL?

Thanks.

<telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" MultipleFileSelection="Automatic" OverwriteExistingFiles="True" OnClientFileUploaded="OnFileUploaded" DropZones="#FileContainerWrap" HttpHandlerUrl="~/File/RadUploadHandler.ashx" EnableInlineProgress="False" OnClientFileUploading="OnFileUploading" OnClientFilesSelected="OnFilesSelected" Width="100" OnClientValidationFailed="OnFileValidationFailed">
</telerik:RadAsyncUpload>

<script type="text/javascript">
function OnFileUploading(sender, args) {
var obj = { CustomerID: window.CustomerID };
                args.set_queryStringParams(obj);
}
.....
</script>

protected
override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName)
{
    try
    {
        var CustomerID = context.Request.QueryString["CustomerID"];

......

5 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 07 Mar 2013, 09:04 AM
Hello Tony,

 
I have tried to reproduce the issue but unfortunately to no avail. I am attaching my sample test web page. Please review it and let me know what else should I add in order to observe the unusual behavior and in which browser it is happening so we could be more helpful.

Regards,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Tony
Top achievements
Rank 1
answered on 12 Mar 2013, 09:39 AM
Hi Plamen,

I only placed the handler's code behind file in Handler.ashx and did a test run of your sample project and the result is the same. Both query string variables contains NULL value when I try to upload larger than 2048KB, but smaller files are fine. I've tried Chrome 25 & IE10 and both produced the same result. I'm running Windows 8, .net 4.5.

Any idea?

Thanks.
<%@ WebHandler Language="C#" Class="Handler" %>
 
using System.Web;
using Telerik.Web.UI;
 
public class Handler : AsyncUploadHandler, System.Web.SessionState.IRequiresSessionState
{
    protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName)
    {
        var queryStringParam1 = context.Request.QueryString["first"];
        var queryStringParam2 = context.Request.QueryString["second"];
      //  SaveToDataBase(file, configuration, context, tempFileName, queryStringParam1, queryStringParam2);
        return CreateDefaultUploadResult<UploadedFileInfo>(file);
    }
}
0
Plamen
Telerik team
answered on 15 Mar 2013, 09:26 AM
Hi Tony,

 
It looks like there is some kind of misunderstanding. Please excuse me for that. Here is a sample video of my test of the same issue where every thing worked as expected. Please review it and let me know if I am not testing properly or I have to add or do something else in order to reproduce the unusual behavior.

Greetings,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Tony
Top achievements
Rank 1
answered on 16 Mar 2013, 03:23 AM
Hi Plamen,

I did exactly what did in the video with your original sample project without any modification and I'm still getting a NULL value. Obviously, this only happens on my station. I thought I remember it was working not long before, and somehow this 2MB issue suddenly happening. Is there any other information I can provide you?

Thanks.
0
Plamen
Telerik team
answered on 20 Mar 2013, 02:23 PM
Hello Tony,

 
Thank you for getting back to us.

The issue seems quite unusual indeed. Would you please test the same web page on other machines around and let us know if the behavior is the same or not? Please share as well the exact configuration of your machine so we could test again and be more helpful.

Regards,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
AsyncUpload
Asked by
Tony
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Tony
Top achievements
Rank 1
Share this question
or