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?
ReceiveHTTPFile to memory, HTTP and HTTPS support
- greyhoundcode
- Enthusiast
- Posts: 112
- Joined: Sun Dec 30, 2007 7:24 pm
-
- Addict
- Posts: 1264
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: ReceiveHTTPFile to memory, HTTP and HTTPS support
It would benefit me. For example, loading an image from the Internet could be done with that command and then CatchImage().
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
-
- Enthusiast
- Posts: 796
- Joined: Tue May 20, 2008 2:12 am
- Location: Cologne, Germany
- Contact:
Re: ReceiveHTTPFile to memory, HTTP and HTTPS support
Hi greyhoundcode,
+1
Yes... It'd be a great function.
+1
Yes... It'd be a great function.
Regards,
JamiroKwai
JamiroKwai
-
- Enthusiast
- Posts: 796
- Joined: Tue May 20, 2008 2:12 am
- Location: Cologne, Germany
- Contact:
Re: ReceiveHTTPFile to memory, HTTP and HTTPS support
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

Regards,
JamiroKwai
JamiroKwai
Re: ReceiveHTTPFile to memory, HTTP and HTTPS support
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.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 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 ...
- greyhoundcode
- Enthusiast
- Posts: 112
- Joined: Sun Dec 30, 2007 7:24 pm
Re: ReceiveHTTPFile to memory, HTTP and HTTPS support
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
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
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Re: ReceiveHTTPFile to memory, HTTP and HTTPS support
It would be handy to also have proxy support to all the new network libs (http, ftp and mail).
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
- greyhoundcode
- Enthusiast
- Posts: 112
- Joined: Sun Dec 30, 2007 7:24 pm
Re: ReceiveHTTPFile to memory, HTTP and HTTPS support
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.

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 PBkandl wrote:you can do that with curl http://www.megaupload.com/?d=P020OM3A
