Jump to content

How Do I download a PHP Server Side generated picture?


KF5WGB
 Share

Recommended Posts

Hi @all,

The web-address where the image is created is: http://www.hamqsl.com/solar101pic.php

One solution was to create an object with

IECreateEmbedded()

and it works fine...until I added the meta tag refresh. Then the image gets "messed'  up. The vertical and horizontal scrollbars show up.
It all started here:

Now I am thinking, what if I just download the created pic and run a timer for 30 minutes and then re-download the image and refresh the pic in the GUI.
I tried the winhttp approach

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("GET", "http://www.hamqsl.com/solar.html", False)

$oHTTP.Send()
$oReceived = $oHTTP.ResponseText
$oStatusCode = $oHTTP.Status

If $oStatusCode == 200 then
 $file = FileOpen("solardata.gif", 2) ; The value of 2 overwrites the file if it already exists
 FileWrite($file, $oReceived)
 FileClose($file)
EndIf

but that does not work with a server side created picture. Is there a way to downlaod that image?
Thanks for any advice.

KF5WGB

 

 

 

 

Link to comment
Share on other sites

55 minutes ago, KF5WGB said:

Is there a way to download that image?  Thanks for any advice.

Have you tried InetGet

Edited by Musashi

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

34 minutes ago, Musashi said:

Have you tried InetGet

Duuuhh. Thanks Musashi. Completely forgot about that one.
Now I have this problem. If the picture was downloaded once before , the next one will be from the Cache and not from the website.

#include <MsgBoxConstants.au3>

if FileExists(@ScriptDir & "\solardata.gif") Then
    ConsoleWrite("erasing old pic" & @CRLF)
    FileDelete(@ScriptDir & "\solardata.gif")
EndIf

InetGet("http://www.hamqsl.com/solar101pic.php","solardata.gif")

Any idea how to clear the cache?

Edited by KF5WGB
forgot something
Link to comment
Share on other sites

22 minutes ago, KF5WGB said:

Any idea how to clear the cache?

-> InetGet -> Options :

$INET_FORCERELOAD (1) = Forces a reload from the remote site ;).

Edited by Musashi

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...