Upload Status

In order to maintain the integrity of incoming files, servedat stores incoming data and information about the transaction in temporary files.  Once the upload is completed, this data is moved to its final destination.  Each upload consists of two files, denoted by the following suffixes:

-sv.tmp The file data received so far.
-sv.met Meta data describing the transaction and the attributes of the file being uploaded.

If these two files exist, it means that an upload is either actively taking place, or it was interrupted.

Querying the Upload Status

A client may retrieve the upload status by attempting to download either the "-sv.met" or "-sv.tmp" files.  Such an attempt will fail with one of the following errors:

Object Busy The file is actively being uploaded.  The error report will describe who is uploading it, how much data has been uploaded, and an estimate of time remaining.
Object Incomplete The upload was interrupted.  The error report will describe who had been uploading it, when it was interrupted, and how much data had been uploaded so far.

With movedat, you can query an upload status directly by using the "-D" option.  For example:

movedat -D me@example.com:dirname/testin-sv.met example.com:dirname/testin-sv.met Failed: Remote Application: Object Incomplete Upload by user "me" was interrupted 29 seconds ago after 2.14 megabytes of 20.0 megabytes

Resuming the Upload

Incomplete uploads can be resumed by repeating the upload attempt.  Depending on the client and options, the user may be prompted for confirmation.  servedat requires, at a minimum, that an upload be resumed by the same user who initiated it and that the date stamp of the file be unchanged.  These requirements may be made more stringent in future updates.

If the file contents have changed since the time of the original upload, then resuming may result in corruption of the uploaded data.  Detection of this is not guaranteed.  If the source file may have changed since the original upload, restart instead of resuming or delete the partial upload.

Restarting the Upload

An interrupted upload can also be restarted from the beginning, effectively deleting the partial upload and beginning again.  Depending on the client options selected, this may occur automatically if the server is unable to resume.  See the individual client documentation for details.

Deleting a Partial Upload

An interrupted upload can be deleted by using an ExpeDat client to delete either the "-sv.met" or "-sv.tmp" file.  Deleting one will automatically delete the other, assuming the client has sufficient permissions to do so.  A busy upload cannot be deleted while it is still active.

Original Files

If a file with the same name as the one being uploaded already exists, that original file will not be deleted until the upload completes successfully.  This ensures that a "good" copy of the file always exists, unless a client explicitly deletes it.  Non-Windows servers will continue to allow the original file to be downloaded.  Active downloads of the original file will not be interrupted, even when the original is replaced by the new version.

Windows servers do not allow the original file to be accessed while an upload with the same file name is pending.  Windows servers will not allow an upload to begin while a download of the same file name is pending.