Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload to Google Drive #186

Open
rahmat-dev opened this issue Mar 11, 2020 · 2 comments
Open

Upload to Google Drive #186

rahmat-dev opened this issue Mar 11, 2020 · 2 comments

Comments

@rahmat-dev
Copy link

Hello all, I try to upload my file to google drive, but I get the name of files in Google Drive is "Untitled". How do I make the file that I upload matches the name that I want?

@petrbela
Copy link

That's probably outside the scope of this library but I think you should be able to send a multipart/form-data with additional attributes for the file? I'd recommend checking the Google Drive docs on how to do this.

@vineetaparodkar
Copy link

vineetaparodkar commented Feb 10, 2021

I tried to upload to google drive but headers get attached to file I am using below options. How to avoid that headers part from updating to file

var path = RNFS.DocumentDirectoryPath + '/' + 'backup.txt';
const options = {
url: https://www.googleapis.com/upload/drive/v3/files,
path:path,
headers: {
'Authorization': Bearer ${googleDriveAccessToken},
},
useUtf8Charset: true,
method: 'PATCH',
type: 'multipart',
field: 'file',
maxRetries: 2,
notification: {
enabled: true,
onProgressTitle: 'Backing Up to Google Drive',
onCompleteTitle: 'Completed Backup to Google Drive',
onErrorTitle: 'Error while Backup of Google Drive',
},
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants