About_Nothing Posted September 9, 2008 Share Posted September 9, 2008 Hi all, I am trying to create an internet file downloader. I've just started with the progressbar for testing. It works fine for the files from internet..) However it doesn't work for the files from local computer( I am using Apache server running on my PC ) I've created it for testing sake. Whenever I download the file from local computer the script gets frozen I have no clue how to fix it.. expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ProgressConstants.au3> $address_URL = "http://localhost/newfile_3.mp3"; it doesn't work on localmachine.. Func Example() Local $msg GUICreate("Downloader",300,100,@DesktopWidth/2 -150 ,@DesktopHeight/2 - 50 ) $progress_download = GUICtrlCreateProgress(10, 10, 200, 20,$PBS_SMOOTH) $button_start= GUICtrlCreateButton ("stahuj",10,40,60,25) $label_progress = GuictrlCreatelabel("",10,70,400,30) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() if $msg=$button_start Then InetGet($address_URL,@DesktopDir & "\music.mp3", 1, 1) $size = InetGetSize($address_URL) While @InetGetActive $BytesRead=@InetGetBytesRead GuiCtrlSetData($label_progress,$BytesRead & "bytes of " & $size) $percentage=($BytesRead/$size)*100 GuiCtrlSetData($progress_download,$percentage) sleep(50) WEnd GuiCtrlSetData($label_progress,"DONE.") EndIf If $msg = -3 Then ExitLoop WEnd GUIDelete() EndFunc Example() Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 9, 2008 Share Posted September 9, 2008 The Apache server probably isn't configured to listen on IP address 127.0.0.1. If you use the network adapter's IP address it will work just fine. Link to comment Share on other sites More sharing options...
About_Nothing Posted September 9, 2008 Author Share Posted September 9, 2008 It works.. >_< Thanks a lot! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now