drive icon indicating copy to clipboard operation
drive copied to clipboard

How can I get uploaded google drive id?

Open bugoverfl0w opened this issue 5 years ago • 4 comments

Hi,

When I upload one file, command

drive push -no-prompt /path/to/file

when it done, how can I get drive id of this file?

Thanks,

bugoverfl0w avatar Feb 13 '20 18:02 bugoverfl0w

Hello @quydox, thank you for the question and welcome to drive!

So the command to list is drive id <path> and it is documented in the README file at https://github.com/odeke-em/drive#retrieving-fileid

odeke-em avatar Feb 13 '20 18:02 odeke-em

Thanks for your reply. It is okay :D

bugoverfl0w avatar Feb 13 '20 18:02 bugoverfl0w

@odeke-em Hi, I want to ask another question here, please help me

I want to push /path/to/local.mp4 in local to remote is path/to/new_file_name.mp4

drive push -no-prompt -files o/new_file_name.mp4 /path/to/local.mp4

But it create folder o/new_file_name.mp4 then push file local.mp4 inside

bugoverfl0w avatar Feb 13 '20 19:02 bugoverfl0w

Unfortunately that option isn't directly there because we mostly want the names to mirror each other for synchronization. However, here is a hack to accomplish it

cat /path/to/local.mp4 | drive push -piped path/to/new_file_name.mp4

Unfortunately I currently don't have time and bandwidth, but otherwise it would be nice to have an option with a name change.

Hope this helps and thank you!

odeke-em avatar Feb 13 '20 19:02 odeke-em