[Mono-devel-list] HttpWorkerRequest

Joe Audette joe_audette at yahoo.com
Mon Dec 13 15:46:35 EST 2004


I think that because the class status page indicates they are not implemented.
I'm using mod_mono with apache.
I get this error:

System.NullReferenceException: Object reference not set to an instance of an object 
in <0x0003e> mojoPortal.Web.RequestStream:ReadPreloaded (byte[],int,int) 
in <0x00038> mojoPortal.Web.RequestStream:Read (byte[],int,int) 
in <0x000b6> mojoPortal.Web.MimePushReader:Parse () 
in <0x00095> mojoPortal.Web.MimeUploadHandler:Parse ()
 in <0x0020a> mojoPortal.Web.HttpUploadModule:context_BeginRequest (object,System.EventArgs) 
in <0x00069> (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
 in <0x00036> EventState:Execute ()
 in <0x00084> StateMachine:ExecuteState (System.Web.HttpApplication/IStateHandler,bool&) 

this is where it occurs in the code:


int ReadPreloaded(byte[] buffer, int offset, int count)

{

int read;

if (_position + count < tempBuff.Length)

read = count;

else

read = tempBuff.Length - (int)_position;

Buffer.BlockCopy(tempBuff, (int)_position, buffer, offset, read);

//for (int i = 0; i < read; i++)

// buffer[offset + i] = tempBuff[_position + i];

return read;

}

 

here is the constructor to RequestStream

 

public RequestStream(HttpWorkerRequest request)

{

this.request = request;

tempBuff = request.GetPreloadedEntityBody();

}

 

I'm thinking tempBuff is null object reference because GetPreloadedEntityBody is not implemented.

 

This code works great in .NET, here is where I found the 

original source code

http://krystalware.com/blog/

 

Its called SlickUpload and handles large file uploads 

and supports a progress bar.

 

Any help or suggestions would be much appreciated. 

 

Best Regards,

 

Joe Audette

 

 


Gonzalo Paniagua Javier <gonzalo at ximian.com> wrote:


On Mon, 2004-12-13 at 10:24 -0800, Joe Audette wrote:
>Hi All,

>I'm trying to get a nice file upload HttpModule working under mono but
>having some trouble.

>It looks like the cause of the problem is the HttpWorkerRequest methods
>are not yet implemented in mono 
>http://www.go-mono.com/class-status-System.Web.html
>Specifically, it is missing the
>GetPreloadedEntityBody()
>GetPreLoadedEntityBodyLength()
>GetTotalEntityBodyLength()
>ReadEntityBody(...) 

>Any idea when these methods will be working?

Why do you think they it fails because of that? If you use xsp, those
methods are actually implemented in classes derived from
HttpWorkerRequest.

-Gonzalo







_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


joe_audette at yahoo.com
http://www.joeaudette.com
http://www.mojoportal.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20041213/c2406c26/attachment.html 


More information about the Mono-devel-list mailing list