Hello Friends!!
In this post, we will see how to download a file from url/internet to your local drive.
' Path of the file you want to download
strFileUrl = "http://abc.com/results/myfile01.zip"
'Local drive's path where you want to save the file
strSaveFileTo = "C:\xxxxxxx\yyyyyyyyy\\xyz.zip"
' create a XMLHTTP object
Set oHTTP = CreateObject("MSXML2.XMLHTTP")
oHTTP.open "GET", strFileUrl, False
oHTTP.send
'create FSO object
Set oFSO = CreateObject("Scripting.FileSystemObject")
'If strSaveFileTo file already exist, delete it
If oFSO.FileExists(strSaveFileTo) Then
oFSO.DeleteFile(strSaveFileTo)
End If
If oHTTP.Status = 200 Then
Dim oADOStream
Set oADOStream = CreateObject("ADODB.Stream")
With oADOStream
.Type = 1
.Open
.Write oHTTP.ResponseBody
.SaveToFile strSaveFileTo
.Close
End With
set oADOStream = Nothing
End If
If oFSO.FileExists(strSaveFileTo) Then
Print "File has been downloaded successfully and save to " & strSaveFileTo
End If
Above code will save any file to your loacal drive at the given path. Now if the file is a ZIP file, you will need to extract it.
Below code will help you to pick any file from local and extract it's content to given folder
'Local drive's path where you want to Extract the file (in case file is a ZIP file)
strExtractFileTo="C:\MyFilePath\"
'If tstrExtractFileTo path does not exist on local drive, create it
Set oFSO = CreateObject("Scripting.FileSystemObject")
If NOT oFSO.FolderExists(strExtractFileTo) Then
oFSO.CreateFolder(strExtractFileTo)
End If
'Extract the contants of the zip file.
Set oShell = CreateObject("Shell.Application")
Set strZIPFiles=oShell.NameSpace(strSaveFileTo).items
oShell.NameSpace(strExtractFileTo).CopyHere(strZIPFiles)
'release objects
Set oFSO = Nothing
Set oShell = Nothing
In this post, we will see how to download a file from url/internet to your local drive.
' Path of the file you want to download
strFileUrl = "http://abc.com/results/myfile01.zip"
'Local drive's path where you want to save the file
strSaveFileTo = "C:\xxxxxxx\yyyyyyyyy\\xyz.zip"
' create a XMLHTTP object
Set oHTTP = CreateObject("MSXML2.XMLHTTP")
oHTTP.open "GET", strFileUrl, False
oHTTP.send
'create FSO object
Set oFSO = CreateObject("Scripting.FileSystemObject")
'If strSaveFileTo file already exist, delete it
If oFSO.FileExists(strSaveFileTo) Then
oFSO.DeleteFile(strSaveFileTo)
End If
If oHTTP.Status = 200 Then
Dim oADOStream
Set oADOStream = CreateObject("ADODB.Stream")
With oADOStream
.Type = 1
.Open
.Write oHTTP.ResponseBody
.SaveToFile strSaveFileTo
.Close
End With
set oADOStream = Nothing
End If
If oFSO.FileExists(strSaveFileTo) Then
Print "File has been downloaded successfully and save to " & strSaveFileTo
End If
Above code will save any file to your loacal drive at the given path. Now if the file is a ZIP file, you will need to extract it.
Below code will help you to pick any file from local and extract it's content to given folder
'Local drive's path where you want to Extract the file (in case file is a ZIP file)
strExtractFileTo="C:\MyFilePath\"
'If tstrExtractFileTo path does not exist on local drive, create it
Set oFSO = CreateObject("Scripting.FileSystemObject")
If NOT oFSO.FolderExists(strExtractFileTo) Then
oFSO.CreateFolder(strExtractFileTo)
End If
'Extract the contants of the zip file.
Set oShell = CreateObject("Shell.Application")
Set strZIPFiles=oShell.NameSpace(strSaveFileTo).items
oShell.NameSpace(strExtractFileTo).CopyHere(strZIPFiles)
'release objects
Set oFSO = Nothing
Set oShell = Nothing
Really interesting article.
ReplyDeleteI tried using it (save to local drive). It does save my file to local drive but the file is not the good size (a few ko only) and cannot be read... Any idea ?
đồng tâm
ReplyDeletegame mu
cho thuê nhà trọ
cho thuê phòng trọ
nhac san cuc manh
số điện thoại tư vấn pháp luật miễn phí
văn phòng luật
tổng đài tư vấn pháp luật
dịch vụ thành lập công ty trọn gói
lý thuyết trò chơi trong kinh tế học
đức phật và nàng audio
hồ sơ mật dinh độc lập audio
đừng hoang tưởng về biển lớn ebook
chiến thắng trò chơi cuộc sống ebook
bước nhảy lượng tử
ngồi khóc trên cây audio
truy tìm ký ức audio
mặt dày tâm đen audio
thế giới như tôi thấy ebook
không bình thường chút nào. Nàng nói như vậy không phải tỏ ý nếu Lưu Phong muốn lên giường với nàng thì cũng nguyện ý sao?
Tam đầu heo vội vàng nói: “Lưu đại thiếu gia, hôm nay ta chỉ chuẩn bị cho một mình Vương Đông Đông. Hay là để hôm nào ta sẽ mời ngươi một mình. Có được chăng?”
Lưu Phong cười hì hì nói: “Ta cũng không có ý kiến gì. Bất quá ta lại nghĩ Vương Đông Đông không muốn rời xa ta. Chu Tam công tử, hôm nay đã không chuẩn bị đầy đủ thì xin để lần khác vậy.”
“Đông Đông, nàng thật sự không muốn một mình cùng ta dùng cơm sao?” Tam đầu heo lộ ra một nụ cười mê người, trong cõi lòng thầm mong Đông Đông đáp ứng.
Giờ phút này có Lưu Phong làm chỗ dựa. Vương Đông Đông lớn mật khinh bỉ liếc mắt nhìn Chu Tam, lạnh lùng nói: “Chu Tam công tử, hộm nay ta và Lưu đại ca có chuyện trọng yếu. Ta nghĩ hôm nay không đi. Xin mời ngươi cứ ăn một mình đi vậy.” Ác giả ác báo, lấy lại được mặt mũi của mình, Vương Đông Đông cố nén ác tâm trong lòng, trợn tròn mắt nhìn Tam đầu heo.
Tam đầu heo mặc kệ thái độ của nàng. Mẹ kiếp các ngươi có chuyện trọng yếu thì cứ đi. Ta sẽ chờ cho đến khi ta rước nàng về dinh thì biết.
Tam đầu heo trong lòng đang có ý nghĩ rất tà ác. Hắn tưởng rằng Vương Đông Đông sớm muộn gì cũng là nữ nhân của hắn. Hắn tưởng Lưu Phong và Vương Đông Đông quả thật là đang có chuyện quan trọng cần làm thật.
“Chờ một chút!”
Tam đầu heo hiểu được có một số việc người văn mình thật không nên làm. Sắc mặt biến đổi, khẽ đứng chắn trước mặt ba người Lưu Phong.
. I am happy that I found your post while searching for informative posts. It is really informative and quality of the content is extraordinary.
ReplyDeleteThanks
upgrade school
Hi,
ReplyDeleteInternet from the "zip" a file you want to download the extension. This "zip" I want to remove the file. Can you share the code ready.
Thanks.
esfileexplorerapkz.info
ReplyDeleteThe next time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I know it was my choice to read, but I actually thought youd have something interesting to say. All I hear is a bunch of whining about something that you could fix if you werent too busy looking for attention.
I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much. download reddit video
ReplyDeleteNo doubt this is an excellent post I got a lot of knowledge after reading good luck. Theme of blog is excellent there is almost everything to read, Brilliant post. 192.168.l.254 is an IP address used by many routers and modems as the default gateway
ReplyDelete
ReplyDeleteThis IP address is one of its kind as this can be used multiple times. This IP address comes under the 24-bit block of the private IP address.
192.168.0.1
192.168.l.1
192.168.15.1
ReplyDeleteThis is default IP address that is used by most of the router companies like the PTCL, TP-Link, D-Link, in order to access the admin page of the router
192.168.10.1