TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Harish Batchu
NA
255
71k
The Files Exist or not in directroy?
Nov 26 2018 10:12 PM
I am checking the file exist in a folder but i am getting every time false. In that folder i have file.
code
-------
string filename = ((Label)e.Item.FindControl("Label2")).Text;
string filePath = @"Uploads\Master\MyDocsFiles\" + filename;
bool fileavail = File.Exists(filePath) ? true : false;
if (fileavail) {
Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filePath + "\"");
Response.TransmitFile(Server.MapPath(filePath));
Response.End();
}
else
{
fileexist.Visible = true;
}
That is the code. Please give me the solution
Reply
Answers (
4
)
Page not displaying correctly in Mobile view
Get list of online active user - Asp.Net Core