You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.
If I try and upload a file with 0 bytes (i.e. empty) then I get a 400 return. However, if I put some content in that file, the file uploads happily. Is this the expected behaviour? I thought it would be to upload the file regardless.
The file is a regular test.txt file using the following code:
No need to set any content if it's going to be empty:
from pydrive import auth, drive
#authorize however you want
gauth = auth.GoogleAuth().LocalWebserverAuth()
#create your drive object
drive = drive.GoogleDrive(gauth)
#Create the file
file1 = drive.CreateFile({'title': 'Hello.txt'})
# Upload the file to your drive
file1.Upload()
If I try and upload a file with 0 bytes (i.e. empty) then I get a 400 return. However, if I put some content in that file, the file uploads happily. Is this the expected behaviour? I thought it would be to upload the file regardless.
The file is a regular test.txt file using the following code:
The text was updated successfully, but these errors were encountered: