Jump to content

nudicles

Members
  • Posts

    4
  • Joined

  • Last visited

nudicles's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Yeah, I noticed that... I guess I can assume that my server falls under that category. Is there a way to be sure? So other than InetGetSize(), is there a way to check to see if a file exists without trying to download the file itself? Thanks guys
  2. Yeah, I checked to be sure, none of the files are password protected. I tried your script #2, what's interesting is that it never gets to the second part of the code (it seems). Anyway, I ran the following code (your code cut in half, and I added a msg box): ;Do the same as the last GUI $url = "http://server/path/to/file.exe" $size = InetGetSize ($url) MsgBox(0, "Size of remote file:", $size) InetGet ($url, @ScriptDir & "\installer.txt", 1, 1) $Form1 = GUICreate("Downloading Resource2...", 341, 83, 193, 123) $Progress1 = GUICtrlCreateProgress(6, 30, 330, 21) GUICtrlSetLimit (-1, $size, 0) $Label1 = GUICtrlCreateLabel("Downloading... "&$URL, 6, 6, 326, 20) $Label2 = GUICtrlCreateLabel("Downloaded 1000mb\1000mb", 6, 54, 330, 20, $SS_RIGHT) GUISetState(@SW_SHOW) GUICtrlSetData ($Label1, "Downloading... "&$URL) While @InetGetActive GUICtrlSetData ($Label2, "Downloaded "&Int (@InetGetBytesRead *1024*1024)&" mb\"&Int ($size*1024*1024)&" mb") Sleep (100) GUICtrlSetData ($Progress1, @InetGetBytesRead) Sleep (100) WEnd ;Tell the user the downloads are complete. MsgBox (0, "Complete!", "All Downloads have been completed!") Here's where it gets funky... I get a msg popup that says the filesize is = 0, however, right after that it starts to download the file fine (showing a large number mb / 0 mb). Why would InetGet work but InetGetSize not? A problem with the server giving correct file size information? Is there a work around? Thanks for your help! (Had to modify the original reply, forgot to take out some semi-sensitive code
  3. Unfortunately the files I'm working with are on my corporate intranet, and are also a little bit of sensitive information. Here's a simple snippet of my code without the actual details $URL = "http://server/path/to/file/build_log.txt";works fine ;$URL = "http://server/path/to/file/installer.exe";returns 0 $size = InetGetSize($URL) MsgBox(0, "Size of remote file:", $size) Just some details about the two different files: build_log.txt size: 2,886,342 bytes installer.exe size: 669,161,958 bytes Any other relevent information?
  4. I'm writing a script to automate the download and install of a program from the internet. InetGet works fine, but InetGetSize always returns 0 for this particular file. It is an EXE, and is about 700MB. There is also a text file in the same directory, 2.5MB, with which inetGetSize works fine. Does inetGetSize only work with a limited filsize, or with certain filetypes? If so, is there an alternative? Thanks guys, Nudi
×
×
  • Create New...