Custom Http Handler

6 posts, 0 answers
  1. Tony
    Tony avatar
    7 posts
    Member since:
    Oct 2010

    Posted 02 Mar 2013 Link to this post

    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"];

    ......

  2. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 07 Mar 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tony
    Tony avatar
    7 posts
    Member since:
    Oct 2010

    Posted 12 Mar 2013 Link to this post

    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);
        }
    }
  5. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 15 Mar 2013 Link to this post

    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.
  6. Tony
    Tony avatar
    7 posts
    Member since:
    Oct 2010

    Posted 15 Mar 2013 Link to this post

    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.
  7. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 20 Mar 2013 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017