Opened 11 years ago

Closed 11 years ago

#2313 closed Bug (Rejected)

InetGet's parameter: filename - bug

Reported by: Relive Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: inetget bug filename Cc:


#include <IE.au3>
$oIE = _IECreate('')
$bodyTxt = _IEBodyReadText($oIE)

$sBlock = StringSplit($bodyTxt, @LF)

$dest = @DesktopDir & '\TEST2\'
$filename = 'Vocaroo_'
$fileType = '.mp3'

For $a = 1 to $sBlock[0] Step 1
	$isMatched = StringRegExp($sBlock[$a], '(http)(:)(\/)(\/)(vocaroo\.com)(\/)(i)(\/)((?:[a-z][a-z]*[0-9]+[a-z0-9]*))')

	If $isMatched = 1 then
		$vocID = StringTrimLeft($sBlock[$a], 21)

		;$hDL = InetGet('' & $vocID & '.mp3', $dest & $filename & $vocID & $fileType)
		$hDL = InetGet('' & $vocID & '.mp3', $dest & $filename & $fileType)

			;ConsoleWrite("Download in progress" & @LF)
		;Until InetGetInfo($hDL, 2)
	ElseIf $isMatched = 0 then
		ConsoleWrite($sBlock[$a] & ' is not a Vocaroo link.' & @CRLF )

A string-trimmed variable $vocID cannot be concatenated with its destination path $dest and file type $fileType. $vocID must be removed in order for a download to happen. Compare
the two InetGet(). By removing the said variable, the next problems occur followed by its reasons:

  • Without Do-until loop with sleep() included, the next download will replace the previous downloaded file.

    This is because the filename must be static (filled in as a raw parameter) and no dynamic variable can be concatenated.

  • With Do-until loop with sleep() included, an infinite loop occurs.

    Not necessarily needed since InetGet() can already pause until it continues to the next download.

Attachments (0)

Change History (1)

comment:1 Changed 11 years ago by Jon

  • Resolution set to Rejected
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.