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
Morcos Adel
NA
195
50.2k
File Upload Control doesn't keep Files
Oct 17 2011 5:58 AM
Hello Experts,
i have a problem using the fileupload control,
Scenario :
i have a preview button which allow the user to preview the uploaded file,the preview button opens a new window with the content of that file,but when i close the popup window the fileuploader no longer have the file,so i have to choose it again...
here is the code for the preview button:
protected void PreviewLink_Click(object sender, EventArgs e)
{
if (ReportUpload.HasFile == true)
{
if (Path.GetExtension(ReportUpload.PostedFile.FileName) == ".csv")
{
String FileSavePath = Server.MapPath("~/Uploads/Reports/Files/");
String FileName = ReportUpload.FileName;
String FullFilePath = FileSavePath + FileName;
ReportUpload.SaveAs(FullFilePath);
Session["CSVPreview"] = Excel.ConvertToHtmlFile(Excel.ReadExcel(FileSavePath, ".csv"));
string script = "window.open('"+"ExcelPreview.aspx"+"','')";
if (!ClientScript.IsClientScriptBlockRegistered("NewWindow"))
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "NewWindow", script, true);
}
}
}
}
any ideas?
Reply
Answers (
1
)
C# Regex : Stop Word Filter expression
What is meaning of main(String[] args)