Page 1 of 1

Download File Problem?

Posted: Thu Jun 27, 2019 3:08 pm
by collectordave
using this URL

http://stampcollector.epizy.com/DBVersion.txt

or stampcollector.epizy.com/DBVersion.txt

In firefox the file downloads and displays no bother.

The file is simple text "Database - 3"

Using this code

Code: Select all

  InitNetwork()

  Filename$ = "C:\Temp\DBVersion.txt"
  If ReceiveHTTPFile("http://stampcollector.epizy.com/DBVersion.txt", Filename$)
    Debug "Success"
  Else
    Debug "Failed"
  EndIf
The programme reports success but the downloaded file contains

"<html><body><script type="text/javascript" src="/aes.js" ></script><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("72a6de536a1c2b05000c649ed3e4da8c");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; location.href="http://stampcollector.epizy.com/DBVersi ... cript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support</noscript></body></html>"

Anyone any ideas??

CD

Re: Download File Problem?

Posted: Thu Jun 27, 2019 3:53 pm
by collectordave
Just tried it with the webgadget and it works and displays ok!

Code: Select all

Global Window_0

Global WebView_0



  Window_0 = OpenWindow(#PB_Any,0, 0, 600, 400, "", #PB_Window_SystemMenu)
  WebView_0 = WebGadget(#PB_Any, 80, 10, 500, 370, "stampcollector.epizy.com/DBVersion.txt")
  
  
  Repeat
      
      Event = WaitWindowEvent()
      Select Event
        Case #PB_Event_CloseWindow
          End
  
      Case #PB_Event_Menu
        Select EventMenu()
        EndSelect
  
      Case #PB_Event_Gadget
        Select EventGadget()
        EndSelect
    EndSelect
    
    ForEver
Is it possible to download a file with the webgadget??

Re: Download File Problem?

Posted: Thu Jun 27, 2019 4:00 pm
by wombats
Hmm. I tried your code with another text file and it worked. Could it be a setting on your web server? I'm assuming the WebGadget can display it because the server is returning HTML and it's interpreting and displaying that.

Re: Download File Problem?

Posted: Thu Jun 27, 2019 4:06 pm
by collectordave
Tried same text file on another server as well and works fine.

With what it returns I am assuming it has some form of security on the server so my search for free web hosting goes on.

Thanks

Re: Download File Problem?

Posted: Thu Jun 27, 2019 4:19 pm
by Marc56us
ReceiveHTTPFile is a file downloader only so does not execute the content in source (vbscript/ javascript)

WebGaget as for him is a browser so execute script inside.

:wink:

Re: Download File Problem?

Posted: Thu Jun 27, 2019 4:30 pm
by collectordave
Thanks all,

Getting the idea.

Recieve file makes a mess of zips as well. However the webgadget downloads all ok except does not save .txt or pdf but displays them not a great problem will rename to something unknown and see how that works.

Leaves just one more thing can the download from the webgadet be directed to a specific folder i.e. changes users download folder until download done?

Re: Download File Problem?

Posted: Thu Jun 27, 2019 6:36 pm
by wombats
It seems InfinityFree have a feature that is designed to cause this behaviour: https://infinityfree.net/support/javasc ... droid-app/.

You can usually find cheap hosting on http://www.webhostingtalk.com/. Getting your own would be best if your software needs to reliably download something it relies on.

Re: Download File Problem?

Posted: Thu Jul 18, 2019 4:24 pm
by collectordave
Using InfinityFree and great as a webpage server found mediafire to host all the files all works fine then.

thanks to all.