Authentication problem with Radupload SL

11 posts, 0 answers
  1. Stephane Priolet
    Stephane Priolet avatar
    12 posts
    Member since:
    Mar 2007

    Posted 16 Oct 2009 Link to this post

    I have a problem with the RadUpload Silverlight.
    When i use the radupload in my local solution, all is OK.

    When my silverlight  application is deployed on a server with windows 2003 SP2 and IIS-6 with Windows Authentication (i can't change it, the application needs it ), I have an error :
    Handler not found or execution of handler failed!
    the server return : Notfound

    So I've tried to inspect the http request with fiddler and then when the silverlight application access to the RadUploadHandler (ashx file) it return an error 401.2 which is a problem of authentication.

    If I try the uri of the file .ashx in ie the response is normal :
    {"JSONData":[{"Key":"RadUAG_message","Value":"Empty file name"},{"Key":"RadUAG_success","Value":false}]}

    Could you help me to find the way to have authentication information when the radupload SL call the ashx.
    Thanks

  2. Ivan
    Admin
    Ivan avatar
    519 posts

    Posted 19 Oct 2009 Link to this post

     Hello Stephane,

    Thank you for your interest in the RadUpload for Silverlight.

    After careful previewing of your message I am thinking about three possible problems:
    1. Windows authentication. Please note the upload control doesn't support windows authentication, but I am not sure is this one a problem because you are able to access the handler via browser.
    2. The UploadServiceUrl property is initialized with an absolute (full) address for the upload handler. In this case you should change/correct the address (and recompile your Silverlight application) before the deployment. If the upload handler resides in the same domain as the Silverlight application than you can use a relative address of the upload handler. In this case you should not change the address before the deployment.
    3. The Cross domain case. If the upload handler is on a domain different from the domain of the Silverlight application then you should deploy/setup a
      More about this issue and how to resolve it you can find in links below:
      Network Security Access Restrictions in Silverlight
      Enabling cross-domain calls for Silverlight apps on self-hosted web services
      Silverlight cross domain policy file helpers

    If no one of above mentioned points is your case please send us a sample project to investigate the issue.


    Regards,
    Ivan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. o
    o avatar
    1 posts
    Member since:
    Jul 2010

    Posted 26 Jul 2010 Link to this post

    i think my problem is not about athenticaiton problem  but i can not upload anything . In FileUploadFailed event ,  e.HandlerData.Message is null .  There is no error log so how can i understand the error 
  5. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 27 Jul 2010 Link to this post

    Hello Stephane Priolet,

    Did you get the warning icon when trying to upload? On the tooltip of the icon is displayed the message.
     It is weird that you don't see the message in the uploadfailed event.

    What is the version of the dlls that you are using? We had an issue with Q1.SP2 not reporting correctly the errors. This issue is fixed in the latest bits.

    Kind regards,
    Valentin.Stoychev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Richard Weissenberg
    Richard  Weissenberg avatar
    11 posts
    Member since:
    Jun 2009

    Posted 23 Aug 2010 Link to this post

    Hi,

    I am using Q1 SP2 and not seeing any errors. My scenario uses relative paths, no additional post data and no modification to the HttpHandler. I can't seem to upload any files, it shows the error icon (yellow triangle) but no error message occurs in the tooltip or whilst debugging.

    When I provide a false UploadServiceUrl that I know does not exist, then I do get HttpHandlerNotFound error on the tooltip.

    When I put a break point on the server side HttpHandler (overriding ProcessRequest), my break point is not hit. When I override ProcessRequest and set a break point here, it is hit.

    Does a later version fix the no error displayed bug? Edit: Tested the beta version of Q2 609 - still no error message.

    It seems like the httpRequest.Files is empty - is supposed to be like this?

    Edit:
    I just ran the test through FireBug and this is the Request and Response when I hit Upload:

    Headers:
    Response Headersview source
    Cache-Control   private
    Content-Length   132
    Content-Type   text/html; charset=utf-8
    Server   Microsoft-IIS/7.5
    X-AspNet-Version   4.0.30319
    X-Powered-By   ASP.NET
    Date   Mon, 23 Aug 2010 10:45:33 GMT
    Request Headersview source
    Host   localhost
    User-Agent   Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
    Accept   text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language   en-us,en;q=0.5
    Accept-Encoding   gzip,deflate
    Accept-Charset   ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive   115
    Connection   keep-alive
    Cookie   ASP.NET_SessionId=jzvw2uwbhm2joei1fsknfawf; .ASPXAUTH=CDFE68180CAC9780E5BC7EC2B262527F64754B2CFCBAF1FCECB1B1E7AF51F6B3C4F50DAC9FBC0A8E8190AE107B3D6C78F7823E9F97D05CAE207019269BEC373B6C757646E26D25AA69898781F4BF814A; CurrentUserID=1




    Post:

    Source
    Referer:http://localhost/bla/ClientBin/FPI.blah.xap Content-Length: 42736 Content-Type: multipart/form-data; boundary=---------------------------8d8d8c8d-cc37-4320-8161-32a5375eecf6 -----------------------------8d8d8c8d-cc37-4320-8161-32a5375eecf6 Content-Disposition: form-data; name="0_RadUAG_fileName" cheese-platter.jpg -----------------------------8d8d8c8d-cc37-4320-8161-32a5375eecf6 Content-Disposition: form-data; name="0_RadUAG_position" 0 -----------------------------8d8d8c8d-cc37-4320-8161-32a5375eecf6 Content-Disposition: form-data; name="0_RadUAG_newFileRequest" True -----------------------------8d8d8c8d-cc37-4320-8161-32a5375eecf6 Content-Disposition: form-data; name="0_RadUAG_finalFileRequest" True -----------------------------8d8d8c8d-cc37-4320-8161-32a5375eecf6 Content-Disposition: form-data; name="file0"; filename="0" Content-Type: application/octet-stream

    ....octet stream in here....

    8d8d8c8d-cc37-4320-8161-32a5375eecf6 Content-Disposition: form-data; name="RadUAG_targetFolder" MyFolder -----------------------------8d8d8c8d-cc37-4320-8161-32a5375eecf6 Content-Disposition: form-data; name="RadUAG_targetPhysicalFolder" -----------------------------8d8d8c8d-cc37-4320-8161-32a5375eecf6 Content-Disposition: form-data; name="RadUAG_overwriteExistingFiles" True -----------------------------8d8d8c8d-cc37-4320-8161-32a5375eecf6 Content-Disposition: form-data; name="RadUAG_guid" ef5db6b3-b48e-4f18-84ed-a0ef576617d1 -----------------------------8d8d8c8d-cc37-4320-8161-32a5375eecf6 Content-Disposition: form-data; name="0_RadUAG_finalUploadRequest" True -----------------------------8d8d8c8d-cc37-4320-8161-32a5375eecf6--

    Response:
    {"JSONData":[{"Key":"RadUAG_message","Value":"Empty data stream"},{"Key":"RadUAG_success","Value":false}]}<pre><code>
    </code></pre>



    Look forward to your help.

    Thanks
  7. Richard Weissenberg
    Richard  Weissenberg avatar
    11 posts
    Member since:
    Jun 2009

    Posted 24 Aug 2010 Link to this post

    I found a problem with another HttpModule intercepting the request and doing strange things to it. I disabled this module and my files where then uploading. However the FileUploadFailed event still fires after the files are uploading on the server. The error message is still blank though. The main progress bar stays on 0.

    This is an issue relating to my code of course, but any thoughts on the empty error message will be appreciated.
  8. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 26 Aug 2010 Link to this post

    Hello Richard Weissenberg,

    I am not sure why there is an empty error message. I looked through the code of the Upload and it seems that it always uses localized resources apart from the case where there are IO errors with dropped files.
     Is it possible that you are using custom localization?

    If you can send us a project where this is reproducible, we will be happy to investigate.

    Greetings,
    Miroslav
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. Richard Weissenberg
    Richard  Weissenberg avatar
    11 posts
    Member since:
    Jun 2009

    Posted 26 Aug 2010 Link to this post

    Hi there,

    Well, I don't think it is an IO issue since the file is stored on the server. I deployed the code onto a Win2003 / IIS6 Server box and the upload works 100%. No error icon and no error message. So this is a configuration issue. I am using VS2010/Win7 Enterprise, IIS7 and 2010Q1 (licensed) and tried Q2.815 (assuming trial version, since it was a sample project someone from telerik sent).

    I have tried various AppPool configurations:
    - .Net 4 Classic mode (Load user profile set to true and false)
    - .Net 4 Integrated mode
    - Cassini

    Also added this line to my web.config:
    <add name="RadUploadControlHandler" path="RadUploadControlHandler.ashx" preCondition="integratedMode" verb="*"  type="Telerik.Windows.RadUploadHandler"/>

    How do I check if I am using "custom localization"?

    I have the samples working ok. I will look into a sample project, but I have not been able to reproduce it outside of my existing codebase.

    Any other ideas most welcome.

    Thanks
  10. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 26 Aug 2010 Link to this post

    Hi Richard Weissenberg,

    By custom localization I meant using the LocalizationManager that will allow you to translate the text that appears in the controls. Then if a string is not found in the resources, it may appear as an empty string. It seems that this is not the case either.

    Can you also make sure that you are seeing all exceptions?
    1. Go to Tools -> Options -> Debugging -> General and uncheck "Enable just my code..."
    2. Go to Debug -> Exceptions and check all exception types there.

    When you start the server there may be few handled exceptions. When you try to upload though you may run into an exception does not surface otherwise.

    Regards,
    Miroslav
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  11. Richard Weissenberg
    Richard  Weissenberg avatar
    11 posts
    Member since:
    Jun 2009

    Posted 26 Aug 2010 Link to this post

    Hi Miroslav,

    Thanks for the tips. I have setup the debugging as suggested.

    When I hit upload, I see this exception:
    'pre><code>
    </code></pre>
    ' is not a valid JSON primitive. This error can also occur when extraneous data is present after the JSON data.

    This is as a result of some custom code which is attached to the request writer (by Global.asax) to ironically help us to debug issues :) !

    Once I removed this code, the FileUploaded event was triggered on the client!! I am not sure where this exception originates from, but perhaps could be bubbled up to the top if the RadUpload client control is picking up 'malformed' requests. 2010Q3 :)

    The reason it was working on the iis6 server / our staging environment was because there were compiler directives to only attach the <pre><code> to the request #if debug :).

    I am a happy panda.

    Thanks Miroslav!


  12. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 26 Aug 2010 Link to this post

    Hi Richard,

    I see now that these "<pre><code></code></pre>" were even present in the firebug dump that you sent!

    Thanks for getting back to us, I logged this as a bug since such errors should be surfaced.

    Your Telerik Points have been updated for your feedback.

    Greetings,
    Miroslav
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner