LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stream text file from google drive

Solved!
Go to solution

Hello community,

 

A long time ago I wrote a VBA script which streams the contents of a text file on my Google drive to a variable without creating the text file physically on my HDD. It practially sends and HTTP GET request and responseText returns the contents of the file. (see the code below). I'd like to do the same with LabVIEW but I was failed to write the code. 

 

 

Pls let me know if you have a solution achiving the same functionality.

thanks.

 

 

Dim myURL As String

myURL = "https://drive.google.com/uc?export=download&id=0B-fu3XYz8TUfLXlBQzNvWEthZkk"

Dim WinHttpReq As Object
Set WinHttpReq = CreateObject("MSXML2.ServerXMLHTTP.6.0")
WinHttpReq.Open "GET", myURL, False
WinHttpReq.Send

FileContentsOnGoolgeDrive = WinHttpReq.responseText

Set WinHttpReq = Nothing

0 Kudos
Message 1 of 3
(2,727 Views)
Solution
Accepted by topic author 1984

Use http get.

 

Your URL has a redirect link, so you would "get" it once with your original URL, parse the redirect, and "get" once more. Here's what I see if I use the redirect URL directly. 😄

 

GetGdoc.png

Message 2 of 3
(2,694 Views)

At the end I solved it by translating the VBA script to LV, but I think its overly complicated. Your solution is better as it requires no ActiveX calls. Thanks.

 

stream.png

 

 

 

0 Kudos
Message 3 of 3
(2,688 Views)