make the extension check more generic

git-svn-id: file:///home/svn/framework3/trunk@9218 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
James Lee 2010-05-04 23:01:05 +00:00
parent 81f9b0285f
commit 2e926a1c22
1 changed files with 2 additions and 2 deletions

View File

@ -26,8 +26,8 @@ def upload(session,file,trgloc = "")
location = trgloc
end
begin
ext = file.scan(/\S*(\.exe|\.bat|\.com|\.vbs|\.cmd)/i)
if ext.join == ".exe"
ext = file[file.rindex(".") .. -1]
if ext and ext.downcase == "exe"
fileontrgt = "#{location}\\svhost#{rand(100)}.exe"
else
fileontrgt = "#{location}\\TMP#{rand(100)}#{ext}"