Gonzalo/Simon,

I've been working with an application using the XSP Server. It needs to support uploading of binary files. XSP seems to support uploading of text files, but not binary. After much research, I found a bug in the ReadEntityBody method. It was using a TextReader to read the body of the post. Here's a patch that allows XSP to handle binary uploads. Please review and apply.

Thanks,
Brian


Replace this method in XSPWorkerRequest.cs:

public override int ReadEntityBody (byte [] buffer, int size)
{
WebTrace.WriteLine ("ReadEntityBody()");
if (buffer == null || size == 0)
return 0;

BinaryReader reader=new BinaryReader(output);
byte [] bytes = reader.ReadBytes(size);
bytes.CopyTo(buffer,0);
return bytes.Length;
}




_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus

_______________________________________________
Mono-list maillist - [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to