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
10 Answers, 1 is accepted
Thank you for your interest in the RadUpload for Silverlight.
After careful previewing of your message I am thinking about three possible problems:
- 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.
- The
- 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
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.
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
This is an issue relating to my code of course, but any thoughts on the empty error message will be appreciated.
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
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
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
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!
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