IntraWeb Archive

Some Reminders About SendFile

Some Reminders About SendFile

Just a few reminders about SendFile.

The HTTP protocol is a simple one, which is one reason it is widely used. However it also has it limits. These limits show themselves a few place in IntraWeb, most commonly around file downloads and file uploads.

Non Async Compatible

SendFile will not work in an async event because it relies on sending as stream with a new HTTP request. To use SendFile you must call it from a non async event. Potentially in the future IntraWeb could detect such situations and raise an exception rather than simply not working.

My Page is Locked!

SendFile is usually called from an event that causes a page lock, but IntraWeb does not receive an event after the download starts or completes. Because of this you need to set LockOnSubmit to false when using SendFile. Since we cannot change the LockOnSubmit status when SendFile is called, again potentially IntraWeb in the future might be changed to can exception.