Server side tracking of progress

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Server side tracking of progress

Mitch VanDuyn
What be the easiest way to get the progress information on the server side instead of the client side?

I would like to be able to register the following on the server side during an upload:

1) when the upload begins - get the file name etc
2) as the upload progresses - record the percent complete, etc
3) when the upload completes - do the usual thing

I am currently doing this all right now, but its kind of cumbersome, the client side, gets the info, and then does ajax calls back to the server to report the progress, which is recorded in a database, etc...
Reply | Threaded
Open this post in threaded view
|

Re: Server side tracking of progress

Dean Brettle
Administrator
Create and use a custom UploadStateStoreProvider derived from {Adaptive,SessionBased,InProc}UploadStateStoreProvider that just overrides MergeAndSave() to do what you want with the current UploadState and then calls MergeAndSave() in the base class. --Dean
Reply | Threaded
Open this post in threaded view
|

Re: Server side tracking of progress

Guest-1009
Thanks much... that is exactly what I thought, but I could not get this to work.  I get the following error at runtime:

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: An error occurred creating the configuration section handler for neatUpload: Object reference not set to an instance of an object.

Source Error:

Line 103:			<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></httpModules>
Line 104: </system.web>
Line 105: <neatUpload xmlns="http://www.brettle.com/neatupload/config/2008" defaultStateStoreProvider="IWStateStoreProvider">
Line 106: <providers>
Line 107: <add name="IWStateStoreProvider" type="IWStateStore"/>

IWStateStore is declared as follows:

Imports Microsoft.VisualBasic
Imports Brettle.Web.NeatUpload

Public Class IWStateStore
    Inherits Brettle.Web.NeatUpload.AdaptiveUploadStateStoreProvider

    Public Overrides Sub MergeAndSave(ByVal uploadState As Brettle.Web.NeatUpload.UploadState)
        ' capture additional data here
        MyBase.MergeAndSave(uploadState)
    End Sub

End Class
Reply | Threaded
Open this post in threaded view
|

Re: Server side tracking of progress

Guest-1009
Okay I think I fixed it...

I have to supply both the type name and assembly name which in this case is App_SubCode_VB_Code

By the way... I think I found a small typo in the documentation...

You also have to define the property "description" when subclassing the statestoreprovider

You don't notice it unless you are basing the subclass on the abstract parent class.  In my case not a problem, just something I noticed.