Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
Flask: Uploading pdfs to google drive using its API

for file in files:
filemetadata = {
'name' : secure
filename(file.filename),
'parents' : folder_id
}

#f = io.BytesIO(file)

media = MediaFileUpload(file, mimetype = 'application/pdf')

drive.service.files().create(
body = filemetadata,
media
body = media,
fields = 'id'
).execute()

So here's the part that I can't figure out. What is basically happening is that I have a form that takes in a list of pdf files (max 5 mb for each of those files) but what I can't figure out is how to upload those files to the google drive folder. I

/r/flask
https://redd.it/13gcndv