I’m downloading a file (video) to disk, then uploading it (using app files) to Google Drive as a media object. The issue I’m having is that the files don’t seem to be uploading completely. The file is always about 300MB in size. The following code happens in a background task:
folder = app_files.my_folder
media_object = anvil.media.from_file(f'filename.ts', "video/x-mpeg")
f = folder.create_file(f"filename.ts")
f.set_media(media_object)
Could the issue be the file size? Is there a better option for doing this?
Edit…this doesn’t work either.:
import boto3
client = session.client('s3') #assume key stuff is here
transfer = S3Transfer(client)
transfer.upload_file('filename.ts', 'video_archive', 'filename.ts')
I would prefer to use Google Drive since it makes it easier for me to browse the files.