ReceiveHTTPFile does not support downloading certain https p

Just starting out? Need help? Post your questions and find answers here.
User avatar
gurj
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

ReceiveHTTPFile does not support downloading certain https p

Post by gurj »

sorry,i do not dare to be a bug,thank you!
ReceiveHTTPFile does not support downloading certain https pages

Code: Select all

  InitNetwork()

  Filename$ = "D:\r.htm"
  If ReceiveHTTPFile("https://www.purebasic.com/index.php", Filename$)
    Debug "Success"
  Else
    Debug "Failed"
  EndIf
 
download Failed by:
ReceiveHTTPFile()
ReceiveHTTPMemory()

download Success by:
WebGadget()
ie6

my pc: winxp sp3, x86, ie6, pb5.71

; IDE Options = PureBasic 5.71 LTS (Windows - x86)
; CursorPosition = 18
; EnableXP
; DPIAware
; DisableDebugger
Last edited by gurj on Tue Dec 31, 2019 3:52 pm, edited 1 time in total.
my pb for chinese:
http://ataorj.ys168.com
Marc56us
Addict
Addict
Posts: 1479
Joined: Sat Feb 08, 2014 3:26 pm

Re: ReceiveHTTPFile does not support downloading certain htt

Post by Marc56us »

Try without writing to the root of the disk.
(Recent versions of Windows do not allow it, except in administrator mode.)

Code: Select all

; Filename$ = "D:\r.htm"

Filename$ = GetTemporaryDirectory() + "\r.htm"
Successfully tested, so if it still doesn't work, the problem is somewhere else (Do you use a proxy ?).
User avatar
gurj
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: ReceiveHTTPFile does not support downloading certain htt

Post by gurj »

thanks!
i have and at d:\test\ ,but not.
use a proxy ? ,no.

for https://www.purebasic.com/index.php
why my pc when use
download is ok by:
WebGadget()
or
ie6
.

your pc ok, I have also increased
TLS1.1 and TLS1.2, still not work.
https://blog.csdn.net/xc917563264/artic ... /100554235
my pb for chinese:
http://ataorj.ys168.com
Marc56us
Addict
Addict
Posts: 1479
Joined: Sat Feb 08, 2014 3:26 pm

Re: ReceiveHTTPFile does not support downloading certain htt

Post by Marc56us »

why my pc when use
download is ok by:
WebGadget()
or
ie6
Maybe because:

'The Http commands are based on the network library,'
https://www.purebasic.com/documentation/http/index.html

'The WebGadget uses the Internet Explorer 4.0+ ActiveX object on Windows.'
https://www.purebasic.com/documentation ... adget.html

But that's all I know.
:?:
User avatar
mk-soft
Always Here
Always Here
Posts: 5406
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: ReceiveHTTPFile does not support downloading certain htt

Post by mk-soft »

Maybe over ActiveScript...

Code: Select all

;-TOP

; Comment   : Modul ActiveScript Example 4
; Version   : v2.01

; Link to ActiveScript  : https://www.purebasic.fr/english/viewtopic.php?f=12&t=71399
; Link to SmartTags     : https://www.purebasic.fr/english/viewtopic.php?f=12&t=71399#p527089
; Link to VariantHelper : https://www.purebasic.fr/english/viewtopic.php?f=12&t=71399#p527090

; ***************************************************************************************

XIncludeFile "Modul_ActiveScript.pb"
;XIncludeFile "Modul_SmartTags.pb"
;XIncludeFile "VariantHelper.pb"

UseModule ActiveScript
;UseModule ActiveSmartTags

; -------------------------------------------------------------------------------------

Global vbs.s, result.s, url.s

; Variable als Rumtime definieren zum Zugriff aus VB-Script
Runtime result
Runtime url


; Daten anlegen

url = "https://www.purebasic.com"

; VB-Script schreiben
vbs = ~""
vbs + ~"Dim IE, Result" + #LF$
vbs + ~"Set IE = CreateObject(\"InternetExplorer.Application\")" + #LF$
vbs + ~"IE.Visible = False ' True or hide" + #LF$
vbs + ~"IE.Navigate Runtime.String(\"url\")" + #LF$
vbs + ~"Do While IE.busy = True" + #LF$
vbs + ~"  Runtime.Sleep 500" + #LF$
vbs + ~"Loop" + #LF$
vbs + ~"Result = IE.document.documentElement.outerHTML" + #LF$
vbs + ~"Runtime.String(\"result\") = Result" + #LF$
vbs + ~"IE.Quit" + #LF$

*Control = NewActiveScript()
If *Control
  Debug "************************************************************"
  Debug vbs
  Debug "************************************************************"
  ParseScriptText(*Control, vbs);, #SCRIPTTEXT_ISVISIBLE)
  FreeActiveScript(*Control)
  Debug "************************************************************"
  Debug result
EndIf
Last edited by mk-soft on Mon Dec 30, 2019 3:08 pm, edited 1 time in total.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Kiffi
Addict
Addict
Posts: 1357
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: ReceiveHTTPFile does not support downloading certain htt

Post by Kiffi »

I noticed this:
gurj wrote:

Code: Select all

    [...]
    Debug "Success"
    [...]
    Debug "Failed"
    [...]
[...]

; DisableDebugger
Hygge
User avatar
gurj
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: ReceiveHTTPFile does not support downloading certain htt

Post by gurj »

@Kiffi and Marc56us:
my toolbar have 'Compile without Debugger' and 'Compile with Debugger'
i use 'Compile with Debugger'

@mk-soft, your code to:

1 opened: https://www.purebasic.com

2 [22:25:52] Executable started.
[22:42:40] [ERROR] Modul_ActiveScript.pb (line: 1220)
[22:42:40] [ERROR] Invalid memory access. (read error at address :8)
after closed MessageRequester, IDE is locked, i use other exe kill PureBasic_Compilation2.exe, then:
[22:44:25] The debugged executable quit unexpectedly.

3 MessageRequester and debuged:

[ActiveScriptSite - OnScriptError
---------------------------
Line: 9 Column: 0
---------------------------
ok]

debuged:

Code: Select all

ActiveScriptSite - AddRef() : Refcount 1 > 2
ActiveScriptSite - QueryInterface() : IActiveScriptSiteInterruptPoll -> No Interface
ActiveScriptSite - AddRef() : Refcount 2 > 3
ActiveScriptSite - QueryInterface() : IActiveScriptSiteDebug -> No Interface
ActiveScriptSite - OnStateChange() : State = 5
ActiveScriptSite - OnStateChange() : State = 1
ActiveScriptSite - OnStateChange() : State = 2
************************************************************
Dim IE, Result
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = False ' True or hide
IE.Navigate "https://www.purebasic.com"
Do While IE.busy = True
  Runtime.Sleep 500
Loop
Result = IE.document.documentElement.outerHTML
Runtime.String("result") = Result
IE.Quit

************************************************************
ActiveScriptSite - AddRef() : Refcount 3 > 4
ActiveScriptSite - OnEnterScript()
ActiveScriptSite - GetItemInfo() : SpaceName = Runtime
Runtime - QueryInterface() : IDispatch -> Ok
Runtime - Release() : Refcount = 2 > 1
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
Runtime - GetIDsOfNames() : Name = sleep -> DispId = 5
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() Sleep : 500
Runtime - Release() : Refcount = 2 > 1
ActiveScriptSite - AddRef() : Refcount 4 > 5
ActiveScriptSite - QueryInterface() : IUnknown -> Ok
ActiveScriptSite - Release() : Refcount = 5 > 4
Runtime - GetIDsOfNames() : Name = string -> DispId = 4
Runtime - AddRef() :  Refcount = 1 > 2
Runtime - Invoke() PropertyPutString : result
Runtime - Release() : Refcount = 2 > 1
ActiveScriptSite - QueryInterface() : IUnknown -> Ok
ActiveScriptSite - QueryInterface() : IID {C5598E60-B307-11D1-B27D-006008C3FBFB} -> No Interface
ActiveScriptSite - QueryInterface() : IID {6D5140C1-7436-11CE-8034-00AA006009FA} -> No Interface
ActiveScriptSite - Release() : Refcount = 4 > 3
ActiveScriptSite - OnScriptError()
my pb for chinese:
http://ataorj.ys168.com
User avatar
gurj
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: ReceiveHTTPFile does not support downloading certain htt

Post by gurj »

I find the information and do a lot of tests, probably because the InitNetwork() does not support non-buffering models, but the settings for the site may be just Nocache.
Last edited by gurj on Mon Dec 30, 2019 4:42 pm, edited 1 time in total.
my pb for chinese:
http://ataorj.ys168.com
infratec
Always Here
Always Here
Posts: 6874
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: ReceiveHTTPFile does not support downloading certain htt

Post by infratec »

Have you tried it directly via libcurl (.pbi)?

This gives you more informations about the error.

You get first a:
HTTP/1.1 301 Moved Permanently
I have to add:

Code: Select all

curl_easy_setopt(curl, #CURLOPT_FOLLOWLOCATION, 1)
Then I get the full page.

Code: Select all

ProcedureC ReceiveHTTPWriteToMemoryFunction(*ptr, Size.i, NMemB.i, *Stream)
  
  Protected SizeProper.i  = Size & 255
  Protected NMemBProper.i = NMemB
  
  
  If *ReceiveHTTPToMemoryBuffer = 0
    *ReceiveHTTPToMemoryBuffer = AllocateMemory(SizeProper * NMemBProper)
  Else
    *ReceiveHTTPToMemoryBuffer = ReAllocateMemory(*ReceiveHTTPToMemoryBuffer, MemorySize(*ReceiveHTTPToMemoryBuffer) + SizeProper * NMemBProper)
  EndIf
  
  CopyMemory(*ptr, *ReceiveHTTPToMemoryBuffer + ReceiveHTTPToMemoryBufferPtr, SizeProper * NMemBProper)
  ReceiveHTTPToMemoryBufferPtr + SizeProper * NMemBProper
  
  ProcedureReturn SizeProper * NMemBProper
  
EndProcedure


Procedure.i ReceiveHTTPToMemory(URL$, Proxy$="")
  
  Protected *Buffer, curl.i, Timeout.i, res.i
  
  If Len(URL$)
    
    curl  = curl_easy_init()
    If curl
      
      Timeout = 3
      
      curl_easy_setopt_str(curl, #CURLOPT_URL, URL$)
      curl_easy_setopt(curl, #CURLOPT_SSL_VERIFYPEER, 0)
      curl_easy_setopt(curl, #CURLOPT_SSL_VERIFYHOST, 0)
      curl_easy_setopt_str(curl, #CURLOPT_HEADER, "")
      curl_easy_setopt(curl, #CURLOPT_TIMEOUT, Timeout)
      curl_easy_setopt(curl, #CURLOPT_FOLLOWLOCATION, 1)
      
      If Len(Proxy$)
        curl_easy_setopt_str(curl, #CURLOPT_PROXY, proxy$)
      EndIf
      
      curl_easy_setopt(curl, #CURLOPT_WRITEFUNCTION, @ReceiveHTTPWriteToMemoryFunction())
      res = curl_easy_perform(curl)
      
      If res = #CURLE_OK
        *Buffer = AllocateMemory(ReceiveHTTPToMemoryBufferPtr)
        If *Buffer
          CopyMemory(*ReceiveHTTPToMemoryBuffer, *Buffer, ReceiveHTTPToMemoryBufferPtr)
          FreeMemory(*ReceiveHTTPToMemoryBuffer)
          *ReceiveHTTPToMemoryBuffer = #Null
          ReceiveHTTPToMemoryBufferPtr = 0
        EndIf
      EndIf
      
      curl_easy_cleanup(curl)
      
    EndIf
    
  EndIf
  
  ProcedureReturn *Buffer
  
EndProcedure
User avatar
gurj
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: ReceiveHTTPFile does not support downloading certain htt

Post by gurj »

thanks infratec,sorry, my libcurl.pbi loss curl_easy_setopt_str().
and i do not understand libcurl, i do not know how to do ...
my pb for chinese:
http://ataorj.ys168.com
User avatar
mk-soft
Always Here
Always Here
Posts: 5406
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: ReceiveHTTPFile does not support downloading certain htt

Post by mk-soft »

@gurj

works for me with Window 7 Pro and PB v5.71 (x64)

OnScriptError line 9 ('IE.Quit') ???
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
infratec
Always Here
Always Here
Posts: 6874
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: ReceiveHTTPFile does not support downloading certain htt

Post by infratec »

It is only to make handling of strings easy:

Code: Select all

      CompilerIf #PB_Compiler_Processor = #PB_Processor_x64
        curl_easy_setopt_str(handle.i, option.i, parameter.p-utf8) As "curl_easy_setopt"
        curl_easy_strerror_(errornum.i) As "curl_easy_strerror"
      CompilerElse
        CompilerIf #PB_Compiler_OS = #PB_OS_Linux
          curl_easy_setopt_str(handle.i, option.i, parameter.p-utf8) As "curl_easy_setopt"
          curl_easy_strerror_(errornum.i) As "curl_easy_strerror"
        CompilerElse
          curl_easy_setopt_str(handle.i, option.i, parameter.p-utf8) As "_curl_easy_setopt"
          curl_easy_strerror_(errornum.i) As "_curl_easy_strerror"
        CompilerEndIf
      CompilerEndIf
User avatar
gurj
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: ReceiveHTTPFile does not support downloading certain htt

Post by gurj »

@mk-soft,
OnScriptError line 9 ('IE.Quit') ???

no!

my pc is HP t5400, cpu is 64 bit, intel d425, memory 1G, i use x86 winxp sp3,
my
[ActiveScriptSite - OnScriptError
---------------------------
Line: 9 Column: 0
---------------------------
ok]
Modul_ActiveScript.pb, line7-10:
; Update : 01.06.2019

; Link to ActiveScript : viewtopic.php?f=12&t=71399



; Link to SmartTags : viewtopic.php?f=12&t=71399#p527089

hex, line9 is 3B(;) , normal:
\u0D\u0A\u3B\u20\u4C\u69

if skip blank and ';' line, line9 is 23(#) , normal:
#UseActiveScriptDebugView = #True
\u0D\u0A\u20\u20\u23\u55

my ie6 straight opened to https://www.purebasic.com/ , normal.
---------------
[22:42:40] [ERROR] Modul_ActiveScript.pb (line: 1220)
line1220:
ProcedureReturn #S_OK
EndProcedure
my pb for chinese:
http://ataorj.ys168.com
User avatar
mk-soft
Always Here
Always Here
Posts: 5406
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: ReceiveHTTPFile does not support downloading certain htt

Post by mk-soft »

@Gurj

Stack Corruption on ActiveScriptSite method OnScriptError ?
I am write a PM
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
BarryG
Addict
Addict
Posts: 3324
Joined: Thu Apr 18, 2019 8:17 am

Re: ReceiveHTTPFile does not support downloading certain htt

Post by BarryG »

gurj wrote:ReceiveHTTPFile does not support downloading certain https pages

Code: Select all

  InitNetwork()

  Filename$ = "D:\r.htm"
  If ReceiveHTTPFile("https://www.purebasic.com/index.php", Filename$)
    Debug "Success"
  Else
    Debug "Failed"
  EndIf
  ; IDE Options = PureBasic 5.71 LTS (Windows - x86)
 
download Failed by:
ReceiveHTTPFile()
ReceiveHTTPMemory()
I have the same PureBasic version as you, and your exact code above saved the page to my D: drive with no problem, so I doubt it's a bug.
Post Reply