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

Unhandled exception when uploading via BlackBerry

2 Answers 101 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Phil
Top achievements
Rank 1
Phil asked on 17 Jun 2009, 10:53 AM
Hi,

I'm trying to incorporate RadUpload into our application but am coming across an infuriating issue when trying to upload using a BlackBerry. The BlackBerry client has been written by me and uses its internal HTTP connection objects to achieve this.

If I post the request to an application that doesn't have the RadUpload handlers and just uses Request.Files, the upload is successful.

The error occurs before the request has reached my code. The error I am getting (viewed in event viewer) is:

Event code: 3005
Event message: An unhandled exception has occurred.
Exception information:
    Exception type: NullReferenceException
    Exception message: Object reference not set to an instance of an object.

Stack trace:    at Telerik.Web.UI.Upload.ProgressWorkerRequest..ctor(HttpWorkerRequest wr, HttpRequest request)
   at Telerik.Web.UI.RadUploadHttpModule.CaptureWorkerRequest(Object sender, EventArgs e)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
 
I've examined the packets and compared it to a successful request from our Windows Mobile device and the only potential issue I can see is that BlackBerry doesn't support keep-alive. Is this a show stopper as far as implementing RadUpload goes?

Is there a way of bypassing the RadUpload HTTP handlers without putting the BlackBerry uploader in a separate application with its own web.config?

Thanks for any assistance.

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 17 Jun 2009, 02:01 PM
Hi Phil,

This nullreference exception may occur in case of unsupported HTTP request. We have not tested with BlackBerry as we do not officially support this device. Unfortunately it is not possible to enable RadUploadHttpModule only in certain cases. 

The only method called by the ProgressWorkerRequest's constructor is this:

        private byte[] GetBoundary(HttpRequest request)
        {
            string contentType = request.ContentType;

            const string BOUNDARY = "boundary=";

            int pos = contentType.IndexOf(BOUNDARY);

            return (pos > 0) ? request.ContentEncoding.GetBytes("--" + contentType.Substring(pos + BOUNDARY.Length)) : null;
        }

Perhaps it returns null because the "boundary=" string is not found. You can use the provided source code in order to verify this assumption.

Regards,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Phil
Top achievements
Rank 1
answered on 17 Jun 2009, 03:21 PM
THANK YOU!

I had boundary = (with a space).

You rule!
Tags
Upload (Obsolete)
Asked by
Phil
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Phil
Top achievements
Rank 1
Share this question
or