Aditya Acharya
Aditya Acharya

Reputation: 395

How to track a file is uploaded successfully or not in file upload control using c#?

How to track a file is uploaded successfully or not in file upload control using c# ? so that we can give some custom message?

Upvotes: 0

Views: 484

Answers (1)

Dan Diplo
Dan Diplo

Reputation: 25359

I presume you mean the ASP.NET FileUpload control? In that case you can just check the FileUpload.HasFile Property. If this is true, you have your file. After that, of course, you need to save the file to the filestore or database, but you can check for exceptions in the save method and if you are really paranoid use System.IO.File.Exists() to veryify it is there (presuming you save it to filestore).

Upvotes: 1

Related Questions