Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

SrvRoutine Name(GetImage)
Field_Map For(*output) Field(#xEmployeeImage)
Field_Map For(*output) Field(#xEmployeeImageThumbnail)
Field_Map For(*output) Field(#XEmployeeImageMidSize)
 

* set the BLOB content to file location
#xEmployeeImageThumbnail := 'C:\Users\User1\Pictures\LANSA\Employee00987tb.gif'
 

* set the BLOB content to an External Resource
#xEmployeeImage := #Employee00987.FileName
 

* set the BLOB content to a Bitmap
#xEmployeeImage := #EmpImage00987.FileName
 

Endroutine

Conversely, if you are on the Client and want to select an image to save to the database you will need to utilize the PRIM_WEB.FilePicker and may use something like this in your Web Page.:

Define_Com Class(#PRIM_WEB.FilePicker) Name(#FilePicker) Displayposition(3) Ellipses(Word) Height(56) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(6) Verticalalignment(Center) Width(169) Image(#xImageCamera32) Caption('Select an Image') 

Define_Com Class(#PRIM_IMAG) Name(#Image) Displayposition(4) Left(191) Parent(#COM_OWNER) Tabposition(2) Tabstop(False) Top(6) Height(788) Width(800)
 

Define_Com Class(#PRIM_LABL) Name(#Filename) Displayposition(1) Ellipses(Word) Height(55) Left(197) Parent(#COM_OWNER) Tabposition(4) Tabstop(False) Top(733) Verticalalignment(Center) Width(800)
 
Evtroutine Handling(#FilePicker.FileSelected) File(#File)
 
Define_Com Class(#MyServerMod.SaveImage) Name(#SaveImage) 

* Show the selected image on the page
#Filename := #File.Name
#Image.FileName #xDemoblob := #File.Blob
 

* Save the image to the database
#SaveImage.ExecuteAsync( #File.Blob )
 
Endroutine