recieve image over HTTP ??? Help

Everything else that doesn't fall into one of the other PB categories.
bender-rulez
User
User
Posts: 49
Joined: Mon Mar 14, 2005 11:30 am

recieve image over HTTP ??? Help

Post by bender-rulez »

Hi,
I would need to recieve an image over http to display in pb!

how could that be done?

Thanks
fweil
Enthusiast
Enthusiast
Posts: 725
Joined: Thu Apr 22, 2004 5:56 pm
Location: France
Contact:

Post by fweil »

bender-rulez,

Does your question mean getting an image from an URL ?

In this case the easiest way should be to create a window with a web gadget.

If not maybe you could give more details.

Rgrds
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Some good code for this sort of thing can be found in the code archive on www.purearea.net
@}--`--,-- A rose by any other name ..
bender-rulez
User
User
Posts: 49
Joined: Mon Mar 14, 2005 11:30 am

Post by bender-rulez »

Ok,

what i found already here in the forum is this for getting the image via http

Code: Select all

; Standard Connection Types
#CONNECT_FTP=21
#CONNECT_HTTP=80
#CONNECT_HTTPS=81

Connection.l = OpenConnection("www.example.com",#CONNECT_HTTP) ;OpenConnection
   RecieveNetworkFile( Connection, "download/examples/example.jpg" )
CloseConnection( Connection ) ; close connection 
the image will then recieved?!
what now?

how to display the image or save it to disk?
sorry about that question, but loading an image from disk I know how it works, but getting over the network?!?

I need it for without WinAPI

Thanks
bender-rulez
User
User
Posts: 49
Joined: Mon Mar 14, 2005 11:30 am

Post by bender-rulez »

Sorry Dudes! I got it already! :-)

Corrected Code

Code: Select all

; Standard Connection Types
#CONNECT_FTP=21
#CONNECT_HTTP=80
#CONNECT_HTTPS=81

Connection.l = OpenNetworkConnection("www.example.com",#CONNECT_HTTP) ;OpenConnection
   ReceiveNetworkFile( Connection, "download/examples/example.jpg" )
CloseNetworkConnection( Connection ) ; close connection 
this do the magic! its download the File to the directory where my programm startet from!

Thanks at all!
bender-rulez
User
User
Posts: 49
Joined: Mon Mar 14, 2005 11:30 am

Post by bender-rulez »

damed, my mistake, does not work at all!

Any clues?!
fweil
Enthusiast
Enthusiast
Posts: 725
Joined: Thu Apr 22, 2004 5:56 pm
Location: France
Contact:

Post by fweil »

I guess the problem is that you do not deal well with HTPP / FTP protocols right now ...

When opening an HTTP connection you first have to negociate with the server. Same for an FTP one.
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
User avatar
kenmo
Addict
Addict
Posts: 2053
Joined: Tue Dec 23, 2003 3:54 am

Post by kenmo »

Will DownloadURLToFile not work in this case?
bender-rulez
User
User
Posts: 49
Joined: Mon Mar 14, 2005 11:30 am

Post by bender-rulez »

I solved it already, I will post the code when at home again!

@kenmo: downloadURLtoFile is winAPI, but I do develop for Linux and Windows

thanks at all
Post Reply