Simple example 2013 http request stream into blob field

WarazzWarazz Member Posts: 15
edited 2013-03-25 in NAV Three Tier
Hi,
So glad I got this working finally, want to share this with you all.
Too bad, looks so simple now, lost a bunch of hours of sleep...
Thinking of Dotnet is not yet a reflex as putting on my seatbelts is...


Name DataType Subtype Length
HttpClient DotNet System.Net.Http.HttpClient.'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
MemStream DotNet System.IO.MemoryStream.'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Item Record Item
OutStr OutStream
TestURL Text

TestURL := 'http://......';
HttpClient := HttpClient.HttpClient;

MemStream := MemStream.MemoryStream;
MemStream := HttpClient.GetStreamAsync(TestURL).Result;

Item.FINDFIRST;
Item.Picture.CREATEOUTSTREAM(OutStr);
COPYSTREAM(OutStr,MemStream);
Item.MODIFY;

Answers

Sign In or Register to comment.