Getting Media object jpeg and saving to network drive

Scott Beebe

Reputable Poster
I have been given a request from a client that I consider a bit challenging. They will be storing an image file as a media object attachment. From a UBE I need to grab that image media object and save it as a file to a network location so it can be used in CreateForms.

Has anyone here done this before? I don't want to create a 3rd party DLL to do the work. I need to do all the work within a C business function. Is it a matter of using JDB calls to get the blob field from F00165 and then writing the data stream to a file?

It seems a daunting task, but maybe it's not as tough as I am making out to be. Any help would be appreciated.
 
Scott,

I have played a bit with media objects, mostly text, over the years. But with image media objects, I don't think the image file is held in the database. If I remember correctly, there is a media object queue that points to a directory (by default I think this is on the deployment server) where the image file is stored. There is a row in the F00165 that points/links to the specific file. If my recollection is accurate, all you may need to do is extract the appropriate pointer/link from F00165 and copy the target file to your new //machine/folder.

One possible "spanner in the works" is that the image file may be in a different format.

I hope this is of some help. All the best for meeting your challenge.
 
What release is your client on? Look in the jdekprto.h header and see if you have the jdeGTGet_AllMOType, or the jdeGTGet_Image / jdeGTGet_ImageKeyStr api calls. There are also quite a few others that might work for you as well.

I have used quite a few of the jdeGTxxxxxx calls just recently and they work quite well. For retrieval I used jdeGTGet_AllMOType, and although I am not dealing with images, I believe it will return the image attachment as a byte array, at which point all you would need to do is write it out to a file.
 
I have done something similar.

I created a dummy record with an attached image file (i.e. created a "model " record in F00165).
For each record that needs to be saved, I used the model record, then searc hed the BLOB and replaced it with the correct file name, and inserted it in the actual record.

The length of the file names has to stay the same.





I have been given a request from a client that I consider a bit challenging . They will be storing an image file as a media object attachment. From a U BE I need to grab that image media object and save it as a file to a networ k location so it can be used in CreateForms.

Has anyone here done this before? I don't want to create a 3rd party DLL to do the work. I need to do all the work within a C business function. Is it a matter of using JDB calls to get the blob field from F00165 and then wri ting the data stream to a file?

It seems a daunting task, but maybe it's not as tough as I am making out to be. Any help would be appreciated.

Scott Beebe, CPM Senior Technical Consultant http://www.mywwsoft.com/
 
Hi All,

I have a requirement from client to display all the media objects attached against a work order in the report output.
I have a work order which has text,URL,word document,image files and an other TExt media objects atatched.
Can any one please tell me is there any way to pull all the media objects one after the other into the report to get it printed through create forms.

Thanks
Reddy
 
Back
Top