Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: download image from html  (Read 4302 times)

0 Members and 1 Guest are viewing this topic.

Gregory

  • Newbie
  • *
  • Posts: 41
    • View Profile
download image from html
« on: October 31, 2010, 01:51:35 am »
is possible?

Finn

  • Jr. Member
  • **
  • Posts: 90
    • View Profile
download image from html
« Reply #1 on: October 31, 2010, 09:20:44 am »
Sure it is!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
download image from html
« Reply #2 on: October 31, 2010, 10:03:05 am »
I assume you meant HTTP, not HTML.

It is possible, but not supported yet by sf::Http.
Laurent Gomila - SFML developer

Canadadry

  • Hero Member
  • *****
  • Posts: 1081
    • View Profile
download image from html
« Reply #3 on: October 31, 2010, 10:47:16 am »
How do you think your browser does ?

That's not really hard to do. You send a request to the server for the file (the http protocol is really simple) and you get your data as a char* you just have to split header from body. There you have your image.

Gregory

  • Newbie
  • *
  • Posts: 41
    • View Profile
download image from html
« Reply #4 on: October 31, 2010, 07:23:47 pm »
yes, sorry, I was saying HTTP. I know that is possible, but i wanted make with the sf::Http. In my game i need to download an image with the news, now I'm using a free FTP server, but i don't know if ftp support mores clients than one.

Canadadry

  • Hero Member
  • *****
  • Posts: 1081
    • View Profile
download image from html
« Reply #5 on: October 31, 2010, 07:26:53 pm »
Like i said, it's really simple. You just have to read a few to know what is an http request and what is in the answer.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
download image from html
« Reply #6 on: October 31, 2010, 07:39:27 pm »
Like I said you probably can't use sf::Http, it doesn't support multi-part content yet.
Laurent Gomila - SFML developer