Now I've figured out the other half of this cycle: how to upload image data to a database. The trick seems to be that you upload and download the image data as *text* (as opposed to the imageData of the image, which is binary.) I may have this all wrong conceptually, but that's how it finally made sense to me. This is how I'm doing it for files external to the stack:

  put fld "entryNumber" into tEntryNum
  put "binfile:" & the filename of image "testImg" into fileNm
  put url fileNm into tBits
put "update vocablist set illustration = :1 where item_index='" & tEntryNum & "'" into tQuery get revdb_execute(connID, tQuery,"*btBits") -- ("*b" tells it to send the text as a binary stream.)

For internal files this worked:

  put fld "entryNumber" into tEntryNum
  put image "leaf" into tBits
put "update vocablist set illustration = :1 where item_index='" & tEntryNum & "'" into tQuery
  get revdb_execute(connID, tQuery,"*btBits")

I hope this saves someone some time and frustration.

Devin

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University

_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to