A new Release of Slick Upload is out

Chris Hynes just posted a new release of SlickUpload. Hopefully it will work in mono, I'm going to test it for him this weekend since I'm already using it in mojoPortal. So far it only works with Windows installations of mojoPortal and I must admit I'm dubious that the new version will work in mono not because of any problem in SlickUpload but I'm dubious of mono not behaving the same as .NET on Windows. From my last investigation I already know they don't implement the HttpWorkerRequest.GetPreLoadedEntityBody or I should say in the responses I got from the mailing list they call returning null an implementation but under IIS the sub classes of HttpWorkerRequest do in fact return the portion of the request that is already loaded. The .NET documentation confirms that the super class does in fact return null but to me that just means its up to the sub class to implement it. One person on the list also pointed out that Cassini web server returns null here but I think thats too low a bar. The mono/apache platform needs to compete with Windows/IIS.

Anyway the reason I fear it won't work is I already tried checking for the null on the GetPreLoadedEntityBody call and calling .ReadEntityBody() if null is returned and it didn't work and the .NET documentation says the super class HttpWorkerRequest returns 0 when you call ReadEntityBody() so I'm speculating that mono will return 0  from the ReadEntityBody() method and call it an implementation even though on Windows/IIS the sub classes implement these methods much more usefully.

I will be so pleased if I'm wrong and not entirely surprised but a little, stay tuned to find out.

Comments

Miguel de Icaza

re: A new Release of Slick Upload is out

Saturday, July 23, 2005 12:58:30 PM
The GetPreLoadedEntityBody method is supposed to return as much data as the web server might have consumed in advance of the request being dispatched to System.Web.

If there are applications that depend on this having any data, maybe we could return an empty array instead of null, but code should be coping with this.
Joe

re: A new Release of Slick Upload is out

Saturday, July 23, 2005 1:50:56 PM
Hi Miguel!

Thanks for taking the time to reply to my blog, I'm honored! I read your blog all the time, you are one of my heros.

Its been several versions since I tried to test SlickUpload on mono, I'll give it another try soon, maybe things have changed.
Its no problem to add a check for null on a call to GetPreLoadedEntityBody, an empty array is no more helpful than null in making SlickUpload work.

The question is, is anything useful returned from ReadEntityBody because if GetPreLoadedEntityBody returns null the next step is to call ReadEntityBody and if that doesn't return anything useful then its not possible to make the implementation of SlickUpload work. In IIS both these calls do return something  useful but it would be sufficient in mono if ReadEntityBody returns data similar to what you would get under IIS.

Although I can't step through the code on mono, I have log4net setup now so I will try and get more detailed info on what behavior occurs under IIS vs mod_mono/apache2.

SlickUpload is a nice feature because it helps handle large uploads and makes it possible to have a progress bar. The only downside is the license isn't as free as I wish it were.

~ Joe
Gonzalo Paniagua

re: A new Release of Slick Upload is out

Saturday, July 23, 2005 7:34:05 PM
Hi there.

Mono xsp does return null, but still has the buffer around and will return that data when you call ReadEntityBody. Yes, I think that it's a bare minimum implementation, but you should be dealing with a null/empty array there.

And, yes, I'm going to do something about that and make it work as anyone would expect in SVN head.

Thanks.
Joe

re: A new Release of Slick Upload is out

Sunday, July 24, 2005 10:38:42 AM
Hi Gonzalo,

I'll give it a try and keep my eye on any new changes in svn. I appreciate all the attention on this. There was once a bug posted in relation to SlickUpload
http://bugzilla.ximian.com/show_bug.cgi?id=71587

In it you mention that there is not support for multipart-formdata in HttpRequest and that a separate bug should be filed on that. I don't think Chris followed up with a second bug report on that or whether it currently is supported but that is also needed for SlickUpload to be able to work in mono as that is how it determines whether the request is an upload attempt that it should handle or a regular request.

Many Thanks!

Joe

re: A new Release of Slick Upload is out

Wednesday, July 27, 2005 2:13:07 AM
Hi Joe,

I've been looking into this and I have good news and bad news.  The good news is that I have a patch that will make SlickUpload work under XSP.  I'll commit that patch later today.  The bad news is that the patch and the design of SlickUpload in general won't work under mod_mono.  SlickUpload relies on being able to use System.Reflection to change some private fields of the host's HttpWorkerRequest implementation.  I found the private fields of XSPWorkerRequest that would need to be changed, but ModMonoWorkRequest is implemented in such a way that there doesn't appear to be a way to achieve the desired effect.

Anyway, I have a couple ideas for completely different designs that I'm planning to investigate.  If I can get one of them to work, we can replace SlickUpload.  That would allow us to avoid the no-commercial-use license issue as well.

--Dean

Joe

re: A new Release of Slick Upload is out

Wednesday, July 27, 2005 5:56:26 PM
Sounds great Dean! Keep me posted.  Ideally we would have 1 solution that would work under Windows or mono but even if we end up with 2 implementations its still awesome. Not knowing what your ideas are of course maybe it will work in both but just saying even if it only works on mono its would still be great.

Let me know if I can help in any way.

Joe

re: A new Release of Slick Upload is out

Thursday, July 28, 2005 3:56:53 AM
I think it will work on both platforms, but I'll need someone else to test it on Windows.  I'll let you know when I have something.  I might not get to it until next week though.

--Dean

re: A new Release of Slick Upload is out

Monday, May 21, 2007 7:34:00 AM
Comments are closed on this post.