Click here to Skip to main content
15,901,283 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all

Like naukri and other job portals i want to upload the file and when i click view it should display the resume below..

Please tell me how to do that

Thank you
Posted

You will need to write your own code using Word Interop dlls to read the text and the formatting from word documents and create HTML from them. Then you can load the generated HTML file into a iframe in the page.

Check this link[^] Its not free..
 
Share this answer
 
To upload a docx file use below code,

protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile && FileUpload1.PostedFile != null)
{
int ilength =
Convert.ToInt32(FileUpload1.PostedFile.ContentLength);
string content = FileUpload1.PostedFile.ContentType;
string file_name = FileUpload1.FileName;
Byte[] bytecontent = new Byte[ilength];

con = new SqlConnection();
con.ConnectionString = "Server=sqlserver;
Database=master; Trusted_Connection=True";
con.Open();

string sql = "insert into
files(file_data,name,content_type,file_size)VALUES(@file, @name, @content,
@size)";
try
{
SqlCommand cmd = new SqlCommand(sql, con);
FileUpload1.PostedFile.InputStream.Read(bytecontent, 0,
FileUpload1.PostedFile.ContentLength);
cmd.Parameters.AddWithValue("@file", bytecontent);
cmd.Parameters.AddWithValue("@name", file_name);
cmd.Parameters.AddWithValue("@content", content);
cmd.Parameters.AddWithValue("@size", ilength);
int i = cmd.ExecuteNonQuery();
TextBox1.Text = i.ToString();
}
catch (Exception ex)
{
TextBox1.Text = ex.Message;
}
finally
{
con.Close();
}

}


To display it you have to add

<a href="your file path" runat="server" id="filedisplay" />
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900