Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

[MBS] CURLSMBS problem (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] Subclassing FSEventsMBS
Next thread: [MBS] [ANN] 14.0pr4


Re: [MBS] AuthorizationMBS   -   Garth Hjelte
  [MBS] CURLSMBS problem   -   Maximilian Tyrtania
   Re: [MBS] CURLSMBS problem   -   Christian Schmitz
    Re: [MBS] CURLSMBS problem   -   Maximilian Tyrtania

[MBS] CURLSMBS problem
Date: 20.01.14 11:02 (Mon, 20 Jan 2014 11:02:50 +0100)
From: Maximilian Tyrtania
Hi,

I’m using the 13.2 version of the plugins (testing with Xojo 2013r3.2 on Mavericks).

I got a nasty little problem with reading pictures from an URL. The following methods returns the pictures just fine - but not the ones I get from facebook. So, for example this url "https://graph.facebook.com/9005320/picture?width=150&height=150“ doesn’t return a picture (d.OutputData is an empty string, no error is set). If you paste this URL into a browser you’ll see the picture though.

I’m a bit at a loss, because the method seems to work with all other URLs I tried.

Function getPictureFromURL(URL as String) As Picture

if URL="" then Return nil

dim result as Picture
dim cacert as FolderItem=app.BundleResourceFolderMBS.Child("cacert.pem")
if cacert is nil or cacert.Exists=false then
Break
Return nil
end if

dim d as new CURLSMBS

d.OptionSSLVerifyHost = 2 // verify server
d.OptionSSLVerifyPeer = 1 // proofs certificate is authentic

d.OptionCAInfo = cacert.UnixpathMBS

// collect data, so we don't need our own subclass with events
d.CollectOutputData = true

d.OptionURL=Url
dim error as integer=d.Perform

// convert image from output data
result = App.getPictureFromBinaryString(d.OutputData) //left out here, but the problem is that
// d.OutputData is an empty string

if error<>0 then
MsgBox(Language.kProblemWithPicture+Url+"."+EndOfLine+"Error:"+str(error))
end if

Return result

End Function

I might have to set additional parameters in the CURLSMBS, but I’m not sure which. Any pointers?

tia,

Maximilian Tyrtania
http://www.contactking.de

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] CURLSMBS problem
Date: 20.01.14 11:29 (Mon, 20 Jan 2014 11:29:32 +0100)
From: Christian Schmitz

Am 20.01.2014 um 11:02 schrieb Maximilian Tyrtania <<email address removed>>:

> Hi,
>
> I’m using the 13.2 version of the plugins (testing with Xojo 2013r3.2 on Mavericks).
>
> I got a nasty little problem with reading pictures from an URL. The following methods returns the pictures just fine - but not the ones I get from facebook. So, for example this url "https://graph.facebook.com/9005320/picture?width=150&height=150“ doesn’t return a picture (d.OutputData is an empty string, no error is set). If you paste this URL into a browser you’ll see the picture though.
>

d.OptionFollowLocation = true
d.OptionMaxRedirs = 5


there is a redirect coming back from Facebook.

Sincerely
Christian

--

Re: [MBS] CURLSMBS problem
Date: 20.01.14 13:57 (Mon, 20 Jan 2014 13:57:00 +0100)
From: Maximilian Tyrtania
Am 20.01.2014 um 11:29 schrieb Christian Schmitz <<email address removed>>:

> d.OptionFollowLocation = true
> d.OptionMaxRedirs = 5
>
> there is a redirect coming back from Facebook.

Aaah, bingo, thanks a lot!

Maximilian Tyrtania
http://www.contactking.de
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info