Question Ponnumani Gurusamy · Sep 23, 2016

Stream .File Binary

I tried to get a image from user . But It did not run. So please solve this problem

Class Quadramed.Chennai Extends %Persistent
{
Property Image As %Stream.FileBinary(LOCATION = "C:/Images");
Method imagefile()
{
obj = ##class(Sam.binary).%New()
"enter your name",img
obj.Image.Write(img)
status = obj.%Save()
}
 

Comments

Eduard Lebedyuk · Sep 23, 2016

Should the user enter the path to the existing image?

0
Ponnumani Gurusamy  Sep 23, 2016 to Eduard Lebedyuk

Existing image as offline or online :? plz give example of  any path of sample.

0
Eduard Lebedyuk  Sep 23, 2016 to Ponnumani Gurusamy

This method links stream object to an existing file:

Method imagefile()
{
  set obj = ##class(Sam.binary).%New()
  read "enter path to image: ",img
  set st = obj.Image.LinkToFile(img)
  write $System.Status.GetErrorText(st)
  set st = obj.%Save()
}
0
Yuval Golan · Sep 25, 2016

1. Notice what Eduard wrote: 

          setst = obj.Image.LinkToFile(img)
 

2. Your class is:

Class Quadramed.Chennai Extends %Persistent

and in your imageFile method you have:

obj = ##class(Sam.binary).%New()

maybe this is your problem?

0
Ponnumani Gurusamy  Sep 26, 2016 to Yuval Golan

Please give one example program of Stream file Binaryand images are store and retrieve these program. I confused this topics.

0