-2

I'm doing a little executable where I upload a file on google drive, but that's not exactly what I wanted. I would like to do a versioning of files on google drive, so as not to take up too much disk space.

My code for upload files

def uploadFile(filename,filepath,mimetype):
file_metadata = {'name': filename}
media = MediaFileUpload(filepath,
                        mimetype=mimetype)
file = drive_service.files().create(body=file_metadata,
                                    media_body=media,
                                    fields='id').execute()
print('File ID: %s' % file.get('id'))

I think I have to change the files.create to another, can you help me with that?

dfundako
  • 8,022
  • 3
  • 18
  • 34
  • 1
    Questions without a clear problem statement are not useful to yourself or others. Please ask a specific question about a specific issue and indicate what research you have already done, what questions are similar but do not address your topic, and provide any relevant code you have tried that does not work. https://stackoverflow.com/help/how-to-ask – tehhowch Apr 27 '18 at 20:21

1 Answers1

0

Read Manage Revisions:

You be using revisions.list to get the different versions of a single file and revisions.get to operate on a specific version.

Adi Mabfalin
  • 316
  • 2
  • 3
  • 12