Documents

I'm trying to retrieve the documents that show in the research tab from Tessitura in their original format (e.g., .jpg, .doc, .ppt, et al).  Is this even possible?  If so, how would I go about doing so on the SQL side, rather than one at a time, pulling up the document in Tessitura and saving it to the hard drive, I presume.

Thank you for your help, Tessiturians.

BONUS WHAT-MIGHT-HAVE-BEEN TRIVIA:  In his youth, Bill Cosby was good enough as a football player to be offered a trial with the Green Bay Packers.

Parents
  • Hi, in an ASP.Net page you could fdo something like below.  This saple does not check for the proper mime types it is just assuming a gif file.   There are a lot of topis on the web about this as well.  The main part is where it strips out the ole header data.

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    public

     

     

    partial class test : System.Web.UI.

    Page

    {

     

     

    protected void Page_Load(object sender, EventArgs

    e)

    {

     

     

    SqlConnection

    m_sqlcnDBC;

     

     

    SqlCommand

    m_sqlcmdObj;

     

     

    m_sqlcnDBC =

     

    new SqlConnection("Data Source=test;Initial Catalog=impresario;User ID=;Password=;max pool size=200"

    );

    m_sqlcnDBC.Open();

    m_sqlcmdObj =

     

    new SqlCommand

    ();

    m_sqlcmdObj.Connection = m_sqlcnDBC;

     

     

     

    DataSet ds = new DataSet("RESULTS"

    );

     

     

    SqlDataAdapter sqladpResult = new SqlDataAdapter("select doc_contents,doc_title from t_cust_doc where customer_no=2187966"

    , m_sqlcnDBC);

    sqladpResult.Fill(ds);

     

     

     

     

     

    const int

    OleHeaderLength = 78;

     

     

    foreach (DataRow datarow in

    ds.Tables[0].Rows)

    {

     

     

    int strippedDataLength = ((byte[])datarow["doc_contents"

    ]).Length - OleHeaderLength;

     

     

    byte[] strippedData = new byte

    [strippedDataLength];

     

     

    Array.Copy((byte[])datarow["doc_contents"

    ], OleHeaderLength,

    strippedData, 0, strippedDataLength);

    Response.ContentType =

     

    "image/gif"

    ;

     

    Response.BinaryWrite(strippedData);

     

    }

    }

    }

Reply
  • Hi, in an ASP.Net page you could fdo something like below.  This saple does not check for the proper mime types it is just assuming a gif file.   There are a lot of topis on the web about this as well.  The main part is where it strips out the ole header data.

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    public

     

     

    partial class test : System.Web.UI.

    Page

    {

     

     

    protected void Page_Load(object sender, EventArgs

    e)

    {

     

     

    SqlConnection

    m_sqlcnDBC;

     

     

    SqlCommand

    m_sqlcmdObj;

     

     

    m_sqlcnDBC =

     

    new SqlConnection("Data Source=test;Initial Catalog=impresario;User ID=;Password=;max pool size=200"

    );

    m_sqlcnDBC.Open();

    m_sqlcmdObj =

     

    new SqlCommand

    ();

    m_sqlcmdObj.Connection = m_sqlcnDBC;

     

     

     

    DataSet ds = new DataSet("RESULTS"

    );

     

     

    SqlDataAdapter sqladpResult = new SqlDataAdapter("select doc_contents,doc_title from t_cust_doc where customer_no=2187966"

    , m_sqlcnDBC);

    sqladpResult.Fill(ds);

     

     

     

     

     

    const int

    OleHeaderLength = 78;

     

     

    foreach (DataRow datarow in

    ds.Tables[0].Rows)

    {

     

     

    int strippedDataLength = ((byte[])datarow["doc_contents"

    ]).Length - OleHeaderLength;

     

     

    byte[] strippedData = new byte

    [strippedDataLength];

     

     

    Array.Copy((byte[])datarow["doc_contents"

    ], OleHeaderLength,

    strippedData, 0, strippedDataLength);

    Response.ContentType =

     

    "image/gif"

    ;

     

    Response.BinaryWrite(strippedData);

     

    }

    }

    }

Children
No Data