file upload verification

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
 
L

Lucas Tam

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.
 
M

Mark Rae

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top