Skip to Content.
Sympa Menu

freetds - Re: Display Image Fields From MSSQL.

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Franck Martin <Franck AT sopac.org>
  • To: 'TDS Development Group' <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Display Image Fields From MSSQL.
  • Date: Wed, 7 Mar 2001 11:39:51 +1200


I don't get any error message.... Can you be more specific? I'm on php3.

Well, If I use a database to store files, it means this is where I want to
store file instead of the hard drive. So I avoid to copy it from the
database to the hardrive of the web server as I cannot control if the record
got updated or not (I could use timestamps and store them on file)...

But so far in my case, the whole process does not impact the performance of
my web server compared to the bandwidth allocated to the web server...

Cheers.

Franck Martin
Network and Database Development Officer
SOPAC South Pacific Applied Geoscience Commission
Fiji
E-mail: franck AT sopac.org <mailto:franck AT sopac.org>
Web site: http://www.sopac.org/
<http://www.sopac.org/> Support FMaps: http://fmaps.sourceforge.net/
<http://fmaps.sourceforge.net/>

This e-mail is intended for its addresses only. Do not forward this e-mail
without approval. The views expressed in this e-mail may not be necessarily
the views of SOPAC.



-----Original Message-----
From: Leo Kwan [mailto:leo_kwan AT hotmail.com]
Sent: Tuesday, 6 March 2001 9:25
To: TDS Development Group
Subject: [freetds] Re: Display Image Fields From MSSQL.


Oh the other hand, would you mind please check your httpd error log files.
I've got a error : Attempting to convert unknown source type 34. Do you
know what had happened??

Moreover, is it a good way to get those image from database every time it
needs? I believe that write them to a file and retrive data from database
one time is enough.

> Here is the php code that I use...
>
> Note that this code removes the OLE container of the object. MS-Access
store
> the image in an ole container by default which get then stored in the
binary
> field... This php code looks for the beginning of the JPEG data by looking
> for the string JFIF. The beginning is then a few characters before...
>
> I hope it helps. It works for me... cf
> http://www.sopac.org.fj/Data/Aerial/Snaps.html?setid=1
>
> ===========================
> <%
> Header("Content-type: image/jpeg");
>
> $conn = sybase_pconnect("SERVER","username","password");
> $ok=sybase_select_db("SOPACDB",$conn);
> if (@$snapid==0)
> {
> $snapid=1;
> }
>
> $result = sybase_query("Snap_Image2vchar ".$snapid);
> $nbrows=sybase_num_rows($result);
>
>
> for ($i = 0 ; $i < $nbrows; $i++)
> {
> sybase_data_seek($result,$i);
> $par = sybase_fetch_object($result);
> if ($i==0)
> {
> // Needs to remove the OLE header if any...
> $pos=strpos($par->Snap,"JFIF");
> echo (substr($par->Snap,$pos-6));
> } else
> {
> echo ($par->Snap);
> }
> }
>
> %>

---
You are currently subscribed to freetds as: [franck AT sopac.org.fj]
To unsubscribe, forward this message to
$subst('Email.Unsub')




Archive powered by MHonArc 2.6.24.

Top of Page