file upload verification

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
Thank you
Lea
 
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?

You don't.

Sorry - you're going to have to build in some safety mechanism (i.e. file
integrity checks, checksums, etc.
 
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...
 
Back
Top