Skip to content
This repository was archived by the owner on Sep 26, 2022. It is now read-only.
This repository was archived by the owner on Sep 26, 2022. It is now read-only.

[feat] support metadata for uploadFile #264

Description

@kyoz

Is your feature request related to a problem? Please describe.

Some backend require not just params but some metadata that come with the files.

Like the Google Drive API. To upload a file to appDataFolder, I have to provide file name and parents (folder) as file's metadata

Ex:

{
      parents: ['appDataFolder'],
      name: 'backup.json',
},

Just like in this plugin

Is there any way to archive with current version. I'v look through the docs but there's seem nothing like that.

There is data option, i'v tried but it seem doesn't work :'(

Describe the solution you'd like
Have option to add metadata for file when upload

Something like this, maybe:

const options = {
      url: `${fileUploadUrl}?uploadType=media`,
      name: 'backup.db',
      filePath: backupFileUrl,
      fileDirectory: Directory.Documents,
      headers: {
        'Authorization': `Bearer ${this.accessToken}`,
      },
      metadata: {
        name: 'backup.db',
        parents: ['appDataFolder']
      },
      progress: true,
};

Http.uploadFile(options).then(res => {
...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions