Hi Guys,
I tried to implement the example given in the below path
http://www.aspdotnet-suresh.com/2010/12/how-to-read-and-write-text-file-using.html?showComment=1346600194190#c2307473857763453433 but its not working in Firefox
as the line
string path = fileupload1.PostedFile.FileName; returns only filename in firefox, so i have altered the code which saves the file on the server and read the file from there.But still its not working
Below is the code
protected void btnRead_Click(object sender, EventArgs e)
{
string path = "~/Docs/" + fileupload1.FileName;
fileupload1.SaveAs(MapPath(path));
if (File.Exists(Server.MapPath(path)))
{
string[] readText = File.ReadAllLines(path);
StringBuilder strbuild = new StringBuilder();
foreach (string s in readText)
{
strbuild.Append(s);
strbuild.AppendLine();
}
textBoxContents.Text = strbuild.ToString();
}
Please help.
Thanks.
Prathap