Jump to content
Sign in to follow this  
Belini

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

Share this post


Link to post
Share on other sites

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


A cross-platform implementation of the AutoIt language

My contributions to the AutoIt Community ##AutoIt at freenode, real-time chat

3fHNZJ.gif

Spoiler

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

Share this post


Link to post
Share on other sites

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


A cross-platform implementation of the AutoIt language

My contributions to the AutoIt Community ##AutoIt at freenode, real-time chat

3fHNZJ.gif

Spoiler

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

Share this post


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

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...