File Upload to folder ? [Resolved]

Posted by Vivekjj under C# on 1/7/2013 | Points: 10 | Views : 954 | Status : [Member] | Replies : 2
Hi ,

i need to validate whether the files are stored in to a folder or not?

for ex: i have stored a files in to a folder using fileupload control but i need check that file is successfully stored or not?




Responses

Posted by: Kundan64 on: 1/8/2013 [Member] Starter | Points: 50

Up
0
Down

Resolved
You can also do in followoing faishon by the use of System.IO:

public bool IsFileExist(string fullPathfilenamewithexten)
{
if (System.IO.File.Exists(fullPathfilenamewithexten))
return true;
return false;
}

When you will pass the file name e.g(c:\kk.doc), it will return True if exist else False.


if file

Vivekjj, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: muralikrishnasurap-12704 on: 1/8/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Vivkek,

DirectoryInfo _DirectoryInfo = new DirectoryInfo("Directory path");
FileInfo[] _fileinfo = _DirectoryInfo.GetFiles();---For each of this file names will solve ur problem

Use diectory info to check whether file is upload in ur selected directory (or) not.

Best Regards
Murali Krishna.S

Vivekjj, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response