Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Rename File in Google Drive

 Post Reply Post Reply
Author
Grajales Debra View Drop Down
New Member
New Member
Avatar

Joined: 09 Jan 2012
Posts: 3
Post Options Post Options   Quote Grajales Debra Quote  Post ReplyReply Direct Link To This Post Topic: Rename File in Google Drive
    Posted: 03 Jul 2018 at 7:51pm
Hi,

I've been able to upload a file to a specific folder, however, I'd like to 
be able to rename that file? I have the TGDriveItem info for the file and I tried using the TADVGDrive.Update function, however, that did not update the file name.

Eric
Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2219
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 04 Jul 2018 at 11:53am
Hi,

Unfortunately it's currently not supported to rename a file with TAdvGDrive on Google Drive.
However, this is a good suggestion and we'll investigate if this function can be added in a future version.
Back to Top
Grajales Debra View Drop Down
New Member
New Member
Avatar

Joined: 09 Jan 2012
Posts: 3
Post Options Post Options   Quote Grajales Debra Quote  Post ReplyReply Direct Link To This Post Posted: 05 Jul 2018 at 6:21pm
Hi,

I was able to get the rename function to work by using the HttpsPatch function.

  url := 'https://www.googleapis.com/drive/v2/files/' + gdriveitem.ID + '?access_token=' + Token_Access;

  AddHeader(headers, 'Content-Type', 'application/json');

  postdata := RawByteString('{'
    + '"title": "' + TMSUTF8Encode(ExtractFileName(newFileName)) + '"'
    + '}');

  Advgdrive1.HttpsPatch(ExtractServer(url),
                        RemoveServer(url),
                        Headers,
                        AnsiString(postdata),
                        resdat);

Hope this helps...

Eric
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 8756
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 06 Jul 2018 at 9:05am
The next TMS Cloud Pack update will have built-in support for this.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down