Click here to Skip to main content
15,919,500 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Windows Client for web portal Pin
Afzaal Ahmad Zeeshan7-Mar-16 5:19
professionalAfzaal Ahmad Zeeshan7-Mar-16 5:19 
GeneralRe: Windows Client for web portal Pin
ashu20018-Mar-16 16:53
ashu20018-Mar-16 16:53 
Questionfile upload file size limit Pin
indian1433-Mar-16 8:31
indian1433-Mar-16 8:31 
AnswerRe: file upload file size limit Pin
Wombaticus6-Mar-16 7:37
Wombaticus6-Mar-16 7:37 
GeneralRe: file upload file size limit Pin
indian1436-Mar-16 16:48
indian1436-Mar-16 16:48 
SuggestionRe: file upload file size limit Pin
Richard Deeming6-Mar-16 23:04
mveRichard Deeming6-Mar-16 23:04 
GeneralRe: file upload file size limit Pin
Wombaticus6-Mar-16 23:15
Wombaticus6-Mar-16 23:15 
QuestionHow to learn C# in Asp.net Mvc Pin
Member 122016262-Mar-16 0:08
Member 122016262-Mar-16 0:08 
AnswerRe: How to learn C# in Asp.net Mvc Pin
Richard MacCutchan2-Mar-16 1:06
mveRichard MacCutchan2-Mar-16 1:06 
GeneralRe: How to learn C# in Asp.net Mvc Pin
Member 122016262-Mar-16 1:26
Member 122016262-Mar-16 1:26 
GeneralRe: How to learn C# in Asp.net Mvc Pin
Richard MacCutchan2-Mar-16 1:49
mveRichard MacCutchan2-Mar-16 1:49 
AnswerRe: How to learn C# in Asp.net Mvc Pin
Manas_Kumar2-Mar-16 18:53
professionalManas_Kumar2-Mar-16 18:53 
AnswerRe: How to learn C# in Asp.net Mvc Pin
Frank Kerrigan4-Mar-16 3:58
Frank Kerrigan4-Mar-16 3:58 
AnswerRe: How to learn C# in Asp.net Mvc Pin
aarif moh shaikh10-Mar-16 20:50
professionalaarif moh shaikh10-Mar-16 20:50 
QuestionVisual Studio 2015 and Metro-UI Pin
xiecsuk29-Feb-16 22:59
xiecsuk29-Feb-16 22:59 
QuestionOpening word/pdf document in another window Pin
indian14329-Feb-16 15:39
indian14329-Feb-16 15:39 
AnswerRe: Opening word/pdf document in another window Pin
Richard MacCutchan29-Feb-16 22:04
mveRichard MacCutchan29-Feb-16 22:04 
GeneralRe: Opening word/pdf document in another window Pin
indian14329-Feb-16 22:26
indian14329-Feb-16 22:26 
GeneralRe: Opening word/pdf document in another window Pin
Blikkies29-Feb-16 23:01
professionalBlikkies29-Feb-16 23:01 
GeneralRe: Opening word/pdf document in another window Pin
indian1431-Mar-16 6:06
indian1431-Mar-16 6:06 
GeneralRe: Opening word/pdf document in another window Pin
indian1431-Mar-16 6:08
indian1431-Mar-16 6:08 
GeneralRe: Opening word/pdf document in another window Pin
indian1431-Mar-16 6:22
indian1431-Mar-16 6:22 
Hey buddy still docx is showing binary data doesn't look good to humans man.
Here is the code, can you please let me know where did I do mistake?
Investigator _objInvestigator = new Investigator();
            InvestigatorService _objinvestigatorService = new InvestigatorService();

            int InvestigatorId;
            InvestigatorId = ((Session["InvestigatorId"] != null) && int.TryParse(Session["InvestigatorId"].ToString(), out InvestigatorId)) ? InvestigatorId : 0;
            _objInvestigator = _objinvestigatorService.GetByInvestigatorId(InvestigatorId);
            if (_objInvestigator != null)
            {
                if ((_objInvestigator.CvFile != null) && !string.IsNullOrEmpty(_objInvestigator.CvFileNameWithExt))
                {
                    String ext = System.IO.Path.GetExtension(_objInvestigator.CvFileNameWithExt);

                    //string path = Server.MapPath("~\E:\karthikeyan\venky\pdf\aaaa.PDF");
                    //WebClient client = new WebClient();
                    //Byte[] buffer = client.DownloadData(path);
                    //if (buffer != null)
                    //{

                    if (ext.ToLower() == ".doc")
                    {
                        Response.ContentType = "application/" + "msword";
                        Response.AddHeader("content-length", _objInvestigator.CvFile.Length.ToString());
                        Response.BinaryWrite(_objInvestigator.CvFile);
                    }
                    else if(ext.ToLower() == ".docx")
                    {
                        Response.ContentType = "application/" + "vnd.openxmlformats-officedocument.wordprocessingml.document";
                        Response.AddHeader("content-length", _objInvestigator.CvFile.Length.ToString());
                        Response.BinaryWrite(_objInvestigator.CvFile);
                    }
                    else if (ext.ToLower() == ".pdf")
                    {
                        Response.ContentType = "application/" + ext;
                        Response.AddHeader("content-length", _objInvestigator.CvFile.Length.ToString());
                        Response.BinaryWrite(_objInvestigator.CvFile);
                    }

                }
            }
Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."

GeneralRe: Opening word/pdf document in another window Pin
Blikkies1-Mar-16 19:48
professionalBlikkies1-Mar-16 19:48 
GeneralRe: Opening word/pdf document in another window Pin
indian1432-Mar-16 15:18
indian1432-Mar-16 15:18 
AnswerRe: Opening word/pdf document in another window Pin
Blikkies29-Feb-16 22:09
professionalBlikkies29-Feb-16 22:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.