Jump to content

Download and upload on google drive


Recommended Posts

I'm trying to upload and download text files to google drive but I did not succeed, can anyone give a tip?

$server = 'drive.google.com/drive/my-drive'
$username = 'belinioliveira@gmail.com'
$pass = 'mypassword'


$Hand = _FTPOpen('Doesnt Matter')
Sleep(200)

_FTPConnect($Hand, $server, $username, $pass)
Sleep(200)
If @error Then
    _FTPConnect($Hand, "http://" & $server, $username, $pass)
    If @error Then MsgBox(0, "Error", "Connect")
EndIf

Sleep(200)

_FTPGetFile($Hand, '/Test.txt', @ScriptDir & '\Test.txt')
If @error Then
    MsgBox(0, "Erro", "Download error")
Else
    MsgBox(4096, "OK", "Download OK")
EndIf

Sleep(200)
IniWrite(@ScriptDir & '\Test.txt', 'DATA', 'value', '1')
Sleep(200)

_FtpPutFile($Hand, @ScriptDir & '\Test.txt', '/')
If @error Then
    MsgBox(0, "Erro", "Upload error")
Else
    MsgBox(4096, "OK", "Upload ok")
EndIf

_FTPClose($Hand)

 

Edited by Belini
Link to post
Share on other sites
6 hours ago, aa2zz6 said:

Have you tried using the google drive API?

I have not tried but I will search on google drive API

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...