"???" <@discussions.microsoft.com> wrote in message
news:83**********************************@microsof t.com...
I asked this question a few days ago, but got no answer.
As it's very important to me, I'm asking again:
How do I write - in an application that uploads a file - code that makes
sure that once a user has started to upload a file, it will continue
uploading till the end, no matter what?
"No matter what" could mean anything. Do you mean e.g. that once a user has
started to upload a file, you want to prevent them from pulling the plug out
of their PC until the file has been completely uploaded? What if there's a
power cut? What if your server goes down in the middle of the transfer?
That said, you could check the length of the file before and after
posting...On the assumption that your using an HtmlInputFile control for
this, it will have a PostedFile.ContentLength property which you could write
away to a database against the PostedFile.FileName property. Then, once
you'd kicked off the upload with the PostedFile.SaveAs method, you could
interrogate the copy of the file on the server and verify that the length
was the same...