display of excel images

Posted by Chaithragm under C# on 1/25/2013 | Points: 10 | Views : 587 | Status : [Member] | Replies : 0
I have developed an application that is working similar to the google docs .
Uploading of documents is working but while viewing , the excel files are downloading.. and its displaying the handler i have used .The rest of files .doc ,pdf are displaying
how to display the excel files ?is their any separate handler?

////////Here is the handler im using for displaying of images

<%@ WebHandler Language="C#" Class="Handler" %>

using System;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using System.Net;

public class Handler : IHttpHandler {

public void ProcessRequest (HttpContext context) {
SqlConnection con = con_manager.getcon();

string sql = "SELECT imagedata FROM file_upload " +
"WHERE row_id=@ScanID";
SqlCommand cmd = new SqlCommand(sql, con);
cmd.Parameters.Add("@ScanID", SqlDbType.VarChar).Value = context.Request.QueryString["id"];

SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read()) //yup we found our image
context.Response.ContentType = "application/pdf";


public bool IsReusable {
get {
return false;



(No response found.)

Login to post response