How to display Image from File Path Name without using BLOB

Excuse me, im new in this forum and learning NAV’s

Here is my problem,

It seems i cant display any picture from a path name eg: C:\test.jpg to a specific field in a page. ive been try using some

InStream and Declare it as BigText, but i didnt found any type of variable to load an InStream data to a field. heres my latest try :

IF NOT ISSERVICETIER THEN
EXIT;
FileToDownload := ‘C:\try.bmp’;
FileVar.OPEN(FileToDownload);
FileVar.CREATEINSTREAM(IStream);
BStr.READ(IStream);
FileVar.Close;

when im try to use BStr as Sourceexpr its just give a text, how can i display the picture from InStream without using XML DOM or inserting to record as BLOB, or its not possible for me to do this? thanks for your reply.

Look at this post

http://www.mibuso.com/forum/viewtopic.php?t=12861

Hi Amol, Thanks For Reply but it seems Hyperlink doesnt solve my problem, because hyperlink only shows up in a new dialog and show image in picture viewer, my problem is i cant display the image as a field in a page, ive try call a hyperlink but to display it on field i dont know where trigger event i must put the code, even it works i think hyperlink only shows a dialog. i’m trying not using BLOB for my company using a big number of images for products… thanks in advance if any suggestions

Look at this post

http://www.mibuso.com/forum/viewtopic.php?t=23593

Look at this post too…

http://www.mibuso.com/dlinfo.asp?FileID=1098

Hi Amol Thanks again.

It seems im already solved this, instead using Hyperlink or Import im just using CREATEOUTSTREAM to temporary display picture with a file from InStream, i dont know if this method have performance issue or related problem, but now im just using a file name in database and not using BLOB or XML…

can you please post the code

Hi, could you please post your solution to this, thanks :slight_smile:

OMG, it wasn’t really that hard :blush:

MyFile.OPEN(aFilename);

MyFile.CREATEINSTREAM(stream_in);

Item.Picture.CREATEOUTSTREAM(stream_out);

COPYSTREAM(stream_out, stream_in);