Seite 1 von 4

HTTPS Download File

Verfasst: 21.05.2018 12:09
von lite
Hallo

Wegen dieser DSGVO Verordnung werden viele Internetseiten von Http auf Https umgestellt.
Bisher hab ich die Datei immer per Winapi herunter geladen.

InternetOpen_
InternetOpenUrl_
InternetReadFile_
InternetCloseHandle_
InternetCloseHandle_

Was mit der Umstellung nicht mehr funktioniert.
Wie ist es wieder möglich ?

Die Suche im Forum brachte wenig nützliches.

Grüße

Lite

Re: HTTPS Download File

Verfasst: 21.05.2018 12:15
von Mijikai
Gibt es eine Beispiel URL ?
Soweit ist mir noch nichts aufgefallen.

Re: HTTPS Download File

Verfasst: 21.05.2018 12:15
von RSBasic
Warum mit WinAPI?
Mit PB gehts problemlos:

Code: Alles auswählen

InitNetwork()

If ReceiveHTTPFile("https://www.rsbasic.de/downloads/live_backup_system.zip", "D:\live_backup_system.zip")
  Debug "Success"
Else
  Debug "Failed"
EndIf


Re: HTTPS Download File

Verfasst: 21.05.2018 12:30
von Mijikai
RSBasic hat geschrieben:Warum mit WinAPI?
Weil PureBasic keine bzw. nur limitierte Funktionen bietet.

Es gibt z.B. keine Möglichkeit den Fortschritt eines Downloads zu ermitteln
diesen ggf. zu unterbrechen oder fortzusetzten.

Die Url: https://www.rsbasic.de/downloads/live_backup_system.zip funktioniert problemlos mit WinApi.

Re: HTTPS Download File

Verfasst: 21.05.2018 13:26
von mk-soft
Wieso?

Ergebnis = HTTPProgress(HttpVerbindung) ...

Re: HTTPS Download File

Verfasst: 21.05.2018 13:42
von Mijikai
mk-soft hat geschrieben:Wieso?

Ergebnis = HTTPProgress(HttpVerbindung) ...
Wie soll das helfen ?

Code: Alles auswählen

#PB_Http_Success    : the download has been successfully finished.
#PB_Http_Failed     : the download has failed.
#PB_Http_Aborted    : the download has been aborted with AbortHTTP().
Es gibt keine Informationen zum aktuellen Fortschritt.

Re: HTTPS Download File

Verfasst: 21.05.2018 13:48
von helpy
Carefully read the PureBasic help:
Return value

The status of the download. It can be the current number of recieved bytes or one of the following value:

Code: Alles auswählen

  #PB_Http_Success    : the download has been successfully finished.
  #PB_Http_Failed     : the download has failed.
  #PB_Http_Aborted    : the download has been aborted with AbortHTTP().
If HTTPProgress returns a negative value it is one of the constants.
If return value is positive the function returns the current number of received bytes.

Re: HTTPS Download File

Verfasst: 21.05.2018 14:02
von Mijikai
helpy hat geschrieben:Carefully read the PureBasic help:
Return value

The status of the download. It can be the current number of recieved bytes or one of the following value:

Code: Alles auswählen

  #PB_Http_Success    : the download has been successfully finished.
  #PB_Http_Failed     : the download has failed.
  #PB_Http_Aborted    : the download has been aborted with AbortHTTP().
If HTTPProgress returns a negative value it is one of the constants.
If return value is positive the function returns the current number of received bytes.
Why in english ?
Your are right about this, but in no way does this invalidate my other points.

I also want to remind everyone that the original question was solely about WinApi !

Re: HTTPS Download File

Verfasst: 21.05.2018 15:49
von helpy
Sorry!
Ich verwende grundsätzlich die englische Hilfe und bin dann in dieser Sprache geblieben.

Mit WinAPI arbeite ich recht wenig, meine Antwort bezog sich nur auf die Aussage "Es gibt keine Informationen zum aktuellen Fortschritt." und hat keineswegs die anderen Punkte in Frage gestellt.

Evt. hilft ja MSDN weiter:
==> https://msdn.microsoft.com/en-us/librar ... s.85).aspx

Das musst Du aber selbst evaluieren. Ich will mich da nicht weiter vertiefen.

Gruß,
Guido

__________________________________________________
URL-Tags hinzugefügt
21.05.2018
RSBasic

Re: HTTPS Download File

Verfasst: 21.05.2018 18:34
von lite
@RsBasic

Danke für dein Beispiel. Es funktioniert prima.

Nur verwende ich für mein Prg PB 5.24 und alles in Winapi.
Alles umschreiben wäre ein riesen Aufwand.
Per Winapi gibt es nix ?

Grüße
Lite