Skip to content

Can not upload file with the path given by @capawesome/capacitor-file-picker #9

@johnsmith0209

Description

@johnsmith0209

Bug Report

Capacitor Version

💊   Capacitor Doctor  💊

Latest Dependencies:

  @capacitor/cli: 7.4.2
  @capacitor/core: 7.4.2
  @capacitor/android: 7.4.2
  @capacitor/ios: 7.4.2

Installed Dependencies:

  @capacitor/cli: 7.4.2
  @capacitor/core: 7.4.2
  @capacitor/android: 7.4.2
  @capacitor/ios: 7.4.2

[success] Android looking great! 👌

"@capawesome/capacitor-file-picker": "7.2.0",
"@capacitor/file-transfer": "1.0.1",

Platform(s)

Android

Current Behavior

With @capawesome/capacitor-file-picker to pick a pdf file, then pass the file path to @capacitor/file-transfer to uploadFile, and get OS-PLUG-FLTR-0011 error.
When I use @capacitor/filesystem to convert path to Uri with getUri(), then i will get OS-PLUG-FLTR-0007 error.

Expected Behavior

Just get the plugin to do its job. Upload file with path given by file-picker.

Code Reproduction

const pickResult = await FilePicker.pickFiles({
    types: ['application/pdf'],
    limit: 1,
});

const options = {
    url: `${baseURL}upload/stream/qiniu`,
    httpMethod: 'POST',
    path: pickResult[0].path,
    mimeType: pickResult[0].mimeType,
    fileKey: 'file',
};
const {
    response,
    responseCode,
    headers,
} = await FileTransfer.uploadFile(options);

Other Technical Details

Additional Context

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions