Page 1 of 1
ReceiveHTTPFile to memory, HTTP and HTTPS support
Posted: Tue Nov 02, 2010 11:02 pm
by greyhoundcode
I suspect I might be a lone voice so far as this request goes - but who knows? If I don't post it then we'll never know ...
Is there the possibility of adapting ReceiveHTTPFile() (or augmenting it with a related procedure) so that we can stream the file into a block of memory rather than saving it directly to disk?
Even better, with support for secure connections. Would this benefit anyone else?
Re: ReceiveHTTPFile to memory, HTTP and HTTPS support
Posted: Wed Nov 03, 2010 12:23 pm
by Seymour Clufley
It would benefit me. For example, loading an image from the Internet could be done with that command and then CatchImage().
Re: ReceiveHTTPFile to memory, HTTP and HTTPS support
Posted: Wed Nov 03, 2010 1:10 pm
by jamirokwai
Hi greyhoundcode,
+1
Yes... It'd be a great function.
Re: ReceiveHTTPFile to memory, HTTP and HTTPS support
Posted: Wed Nov 03, 2010 4:05 pm
by kandl
Re: ReceiveHTTPFile to memory, HTTP and HTTPS support
Posted: Wed Nov 03, 2010 4:18 pm
by jamirokwai
Hi kandl,
most probably, yes...

I did find the libcurl on my mac (/usr/lib/libcurl.dylib), but can't try your example because of some windows-specific-things.
All in all, it would be great to have a native ReceiveHTTPFile to memory like suggested! And HTTPS/SSL throughout whole PB

Re: ReceiveHTTPFile to memory, HTTP and HTTPS support
Posted: Wed Nov 03, 2010 5:28 pm
by USCode
jamirokwai wrote:All in all, it would be great to have a native ReceiveHTTPFile to memory like suggested! And HTTPS/SSL throughout whole PB

I'm glad you suggested the ReceiveHTTPFile to memory feature, I was thinking the exact same thing awhile back would be handy for security reasons.
I suspect the SSL thing is already on Fred/Freak's to-do list but not sure where it's at on that list, priority-wise ...
Re: ReceiveHTTPFile to memory, HTTP and HTTPS support
Posted: Fri Nov 05, 2010 8:08 pm
by greyhoundcode
There are some useful snippets on the forum that achieve pretty much what I have requested but where they are either Windows specific or if they are x-platform do not offer HTTPS support. Still great bits of code though, and all credit to the guys who took the time to write and share them. For instance see this thread:
http://www.purebasic.fr/english/viewtopic.php?t=24101&postdays=0&postorder=asc&start=0
Ace work, but I would still feel happier and more confident with something that is a de facto part of the Pure Basic language.
For what it's worth, just my twopence worth and all that, but apps increasingly tend to be - and perhaps need to be - "connected". Stuff like this is easy in C# which of course sits atop the .Net framework, and I'm sure the appeal for so many of us here is PB's compactness as compared to massive libraries like that, but, anyway, hope this request might be considered.
Cheers,
Greyhound
Re: ReceiveHTTPFile to memory, HTTP and HTTPS support
Posted: Sat Nov 13, 2010 2:17 am
by DoubleDutch
It would be handy to also have proxy support to all the new network libs (http, ftp and mail).
Re: ReceiveHTTPFile to memory, HTTP and HTTPS support
Posted: Sun Nov 14, 2010 9:01 am
by greyhoundcode
Something I enjoy in PHP (very different language I know) is that files can be opened not just when they are on the local file system but via any supported protocols/wrappers - HTTP(S), FTP(S) and the list goes on. Best of all, you can register your own stream wrapper if you are inclined to add support for some other method.
Only mentioning it as an illustration of what works in other languages - certainly not saying, "This is how it should be done," or anything like that.
jamirokwai wrote:
...I did find the libcurl on my mac (/usr/lib/libcurl.dylib), but can't try your example because of some windows-specific-things. All in all, it would be great to have a native ReceiveHTTPFile to memory like suggested! And HTTPS/SSL throughout whole PB

