Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to translate SQL Picture (binary array) to DBF Pictu
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00458797
Message ID:
00458915
Views:
14
All right, Vlad! - It's a big 10-4. Thanks!!
Terry

>Hi!
>
>Ok, here it is. Hope this makes some sense for you. I can convert this to VFP sample code if needed.
>
>Image retrieving part sample:
> 'Response.ContentType="image/gif";
> Set conn = Server.CreateObject("ADODB.Connection")
> Set rs = Server.CreateObject("ADODB.Recordset")
> conn.Open ...
> SQL = "SELECT MyTable.MyImage FROM MyTable WHERE MyTable.ID=" & Request.QueryString("id")
> rs.open SQL, conn ,3 ,3
> Set Field = rs("MyImage")
> BSize = 4096
> FLength = Field.ActualSize
> NumBlocks = FLength \ BSize
> Left = FLength Mod BSize
> Response.BinaryWrite Field.GetChunk(Left)
> For i = 1 To NumBlocks
> Response.BinaryWrite Field.GetChunk(BSize)
> Next
>
>Image saving part sample:
>
>Function SToB(Str)
> Dim I, B
> For I=1 to len(Str)
> B = B & ChrB(Asc(Mid(Str,I,1)))
> Next
> SToB = B
>End Function
>
>....
>rset.Fields("MyImage").AppendChunk(Server.HTMLEncode(Form("MyImage").Item));
>if (Form("MyImage").File != "") {
> rset.Fields("MyImage").AppendChunk (SToB(Form("MyImage").Item))
>}
Imagination is more important than knowledge
Previous
Reply
Map
View

Click here to load this message in the networking platform