1. Yasir Masood
  2. PowerBuilder
  3. Sunday, 27 October 2019 20:04 PM UTC

Hi,

I am using a web service to retrieve a picture from cloud. The picture is stored in a blob.

I can show the picture using the picture object. Now i need to the following three tasks

1. Save the picture

2. Email the Picture.

I am not sure how i can do that. Any help would be appreciated.

Using PB 2017 R3 Build 1858.

 

Thanks

 

 

Roland Smith Accepted Answer Pending Moderation
  1. Monday, 28 October 2019 02:09 AM UTC
  2. PowerBuilder
  3. # 1

My email example has the ability to email blobs directly, you don't have to save it to a file first.

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Sunday, 27 October 2019 23:48 PM UTC
  2. PowerBuilder
  3. # 2

for 

1. Use FileWriteEx()

integer li_FileNum
blob emp_id_pic


SELECTBLOB salary_hist INTO : emp_id_pic
FROM Employee WHERE Employee.Emp_Num = 100
USING Emp_tran;


li_FileNum = FileOpen("C:\EMPLOYEE\EMP_PICS.BMP", &
StreamMode!, Write!, Shared!, Replace!)
FileWriteEx(li_FileNum, emp_id_pic)

FileClose(li_FileNum)

 

For 2, I suggest you download one of Roland's examples on how to send email with smtp. It includes the sending of attachments: http://www.topwizprogramming.com/freecode_emailsmtp.html

or you can check on how to send email with MAPI (I don't recommend it), or you can use Outlook and OLE to send email.

 

Comment
  1. Miguel Leeuwe
  2. Monday, 28 October 2019 01:03 AM UTC
What was the third task?
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.