Closed MateoGonzalez22 closed 1 year ago
Hi, im trying to upload a sqlite3 db file as a backup to drive, i tried the example code in the README that uses newMultipartUploader().
newMultipartUploader()
I tried this:
const databaseFile = await RNFS.readFile(databaseFilePath, 'base64') const res = (await gdrive.files.newMultipartUploader() .setData(databaseFile, MimeTypes.BINARY) .setRequestBody({ name: "database.db" }) .execute() );
Reading the db as base64 seems to work right since i tried writing a new db file based on the base64 content and it works fine.
When the database.db is uploaded its in text/plain mimeType and its unreadable for sqlite editors
I also tried const newDbContent = await gdrive.files.getBinary(id) but writing a file with that content doesnt work
const newDbContent = await gdrive.files.getBinary(id)
I really dont understand how file encoding types work so i dont know if im missing something.
I forget to use .setIsBase64(true), that solved the issue
Congrats 🎉 !
Hi, im trying to upload a sqlite3 db file as a backup to drive, i tried the example code in the README that uses
newMultipartUploader()
.I tried this:
Reading the db as base64 seems to work right since i tried writing a new db file based on the base64 content and it works fine.
When the database.db is uploaded its in text/plain mimeType and its unreadable for sqlite editors
I also tried
const newDbContent = await gdrive.files.getBinary(id)
but writing a file with that content doesnt workI really dont understand how file encoding types work so i dont know if im missing something.