0 registered members (),
1,397
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
load image from a website
#457751
01/29/16 15:27
01/29/16 15:27
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
OP
Expert
|
OP
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
Hey there,
I'm trying to load an image from a website. I already tried acknex's http_-functions but it doesn't really work. http_result returns the correct size of the recieved data (exactly the same as the image), however, the string in which the received data is stored only contains the image's header; it doesn't seem to contain the rest of the file.
Maybe someone knows how to do this properly?
POTATO-MAN saves the day! - Random
|
|
|
Re: load image from a website
[Re: Ch40zzC0d3r]
#457753
01/29/16 16:25
01/29/16 16:25
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
OP
Expert
|
OP
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
I save it into a text file using a loop (maximum is the size which http_result() returned) and file_asc_write. This is the result: Top is received, bottom is the original image (in this case the a8 logo for testing) as you can see, the string doesn't receive all the data. so file_asc_write is writing some data from the ram that is located after the string.
POTATO-MAN saves the day! - Random
|
|
|
Re: load image from a website
[Re: Ch40zzC0d3r]
#457758
01/29/16 19:56
01/29/16 19:56
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
OP
Expert
|
OP
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
Looks like the problem is the http_result() function. It stops writing data into the target string after what seems to be some special character. ...which means there's most likely no possible workaround.
POTATO-MAN saves the day! - Random
|
|
|
Re: load image from a website
[Re: Kartoffel]
#457759
01/29/16 20:02
01/29/16 20:02
|
Joined: Oct 2011
Posts: 1,082 Germany
Ch40zzC0d3r
Serious User
|
Serious User
Joined: Oct 2011
Posts: 1,082
Germany
|
Well, if you would offer some more infos Im sure we can find a workarround for you. If everything fails you can use winapis (sockets) to obtain the data. Easiest workarround for now seems to be Base64 encoding.
Last edited by Ch40zzC0d3r; 01/29/16 20:03.
|
|
|
Re: load image from a website
[Re: Ch40zzC0d3r]
#457761
01/29/16 20:37
01/29/16 20:37
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
OP
Expert
|
OP
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
I offered pretty much all there is to know - I'm using http_sendpost to get an httpID - I use http_result to write the received data into a string That's all
POTATO-MAN saves the day! - Random
|
|
|
Re: load image from a website
[Re: Ch40zzC0d3r]
#457767
01/29/16 21:30
01/29/16 21:30
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
OP
Expert
|
OP
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
But I don't think I can force a website to send the requested file as base64 encoded data I'm not trying to load file from my website, but from another.
POTATO-MAN saves the day! - Random
|
|
|
|