1
Answer

how to read the upload file

yogita dhingra

yogita dhingra

15y
2.9k
1
string docName = fileupNewsLetter.FileName;
                            string ext = null;
                            string name = string.Empty;
                            int totlen = docName.Length;
                            int dot = docName.LastIndexOf('.');
                            int end = dot + 1;
                            int ending = totlen - end;
                            ext = docName.Substring(end, ending);
                            name = "Newletter" + IsRecordExist + "." + ext;
                            if (ext == "pdf")
                            {

                                fileupNewsLetter.PostedFile.SaveAs("C:\\Documents and Settings\\yogita\\Desktop\\Csinvestment\\Admin\\FreeNewsLetter\\" + name + "");
                                lblMsg.Text = "File Save successfully";
                            }
                            else
                            {
                                lblMsg.Text = "Not a Valid File Format only PDF file is allowed";
                            }

i have upload the file now i want to read the file so can any one tell me how to read the file.
i have taken one grid in that image button is thr so while clicking upon the image it will open tht file.
Answers (1)