views:

314

answers:

3

I wrote a custom web part for SharePoint 2007 that loads an existing user control. One of the things the user control does is an asynchronous upload of a file via FTP. I'm using a third-party FTP library that has BeginUpload/EndUpload methods for async file transfer. I also have an update panel in the user control that I use to display a running total of the number of bytes that have been transferred, based on an event raised by the FTP library. I've added all the necessary AJAX settings to web.config.

Everything works great if I run the user control by itself from a separate project. But when I access the web part that hosts the control and try an upload, the FTP library transfers about 64 KB and then the thread it's running on dies. The message I get in the VS output window is:

The thread 'Win32 Thread' (0xf34) has exited with code 0 (0x0).

I get several of those and then the FTP library throws an exception (basically it times out), the IIS worker processes blow up, and the whole thing comes to a halt. Is there something special I need to do in my SharePoint configuration or the web part to make this work? It seems to be something about SharePoint since the same code works fine if SP is out of the picture.

A: 

Tried this a while back, also to no avail. You may want to check out this post.

http://sharemypoint.wordpress.com/category/aspnet/ajax/

theG
A: 

I submitted this problem to Microsoft SharePoint developer support and they were able to reproduce the error with the FTP library I'm using, which comes from ComponentSpace. Normally what I'm trying to do is possible, but for some reason it just didn't want to work.

Their solution was to save the file on the web server by doing a Request.Files(0).SaveAs and then doing the FTP upload. Not ideal, but it gives me the progress indicators I wanted.

Chris Tybur
A: 

Chris Tybur, I have tried their FTP component and found many bugs. I would not recommend ComponentSpace's FTP