Jump to content
Belini

Download and upload on google drive

Recommended Posts

Belini
Posted (edited)

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

Share this post


Link to post
Share on other sites
TheDcoder

I don't think Google Drive allow FTP access :unsure:


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
Belini
TheDcoder

Maybe you can use this software as an FTP bridge to google: https://github.com/andresoviedo/google-drive-ftp-adapter


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
aa2zz6

Have you tried using the google drive API?

Share this post


Link to post
Share on other sites
Belini
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

Share this post


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

×