It is currently Thu Dec 05, 2019 8:27 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Download File Problem?
PostPosted: Thu Jun 27, 2019 3:08 pm 
Offline
Addict
Addict

Joined: Fri Aug 28, 2015 6:10 pm
Posts: 1034
Location: Portugal
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:
  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/DBVersion.txt?i=1";</script><noscript>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

_________________
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.


Top
 Profile  
Reply with quote  
 Post subject: Re: Download File Problem?
PostPosted: Thu Jun 27, 2019 3:53 pm 
Offline
Addict
Addict

Joined: Fri Aug 28, 2015 6:10 pm
Posts: 1034
Location: Portugal
Just tried it with the webgadget and it works and displays ok!

Code:
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??

_________________
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.


Top
 Profile  
Reply with quote  
 Post subject: Re: Download File Problem?
PostPosted: Thu Jun 27, 2019 4:00 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 29, 2011 5:03 pm
Posts: 504
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Download File Problem?
PostPosted: Thu Jun 27, 2019 4:06 pm 
Offline
Addict
Addict

Joined: Fri Aug 28, 2015 6:10 pm
Posts: 1034
Location: Portugal
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

_________________
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.


Top
 Profile  
Reply with quote  
 Post subject: Re: Download File Problem?
PostPosted: Thu Jun 27, 2019 4:19 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Feb 08, 2014 3:26 pm
Posts: 715
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:

_________________
(English is not my native language, I use an online translator)
Windows 10 Family x64 + Linux (Slackware, Debian on Oracle VirtualBox 6.0) + Raspberry Pi


Top
 Profile  
Reply with quote  
 Post subject: Re: Download File Problem?
PostPosted: Thu Jun 27, 2019 4:30 pm 
Offline
Addict
Addict

Joined: Fri Aug 28, 2015 6:10 pm
Posts: 1034
Location: Portugal
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?

_________________
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.


Top
 Profile  
Reply with quote  
 Post subject: Re: Download File Problem?
PostPosted: Thu Jun 27, 2019 6:36 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 29, 2011 5:03 pm
Posts: 504
It seems InfinityFree have a feature that is designed to cause this behaviour: https://infinityfree.net/support/javascript-error-using-api-or-mobile-android-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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Download File Problem?
PostPosted: Thu Jul 18, 2019 4:24 pm 
Offline
Addict
Addict

Joined: Fri Aug 28, 2015 6:10 pm
Posts: 1034
Location: Portugal
Using InfinityFree and great as a webpage server found mediafire to host all the files all works fine then.

thanks to all.

_________________
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye