apache / apache/cordova-plugin-file-transfer

how to update file name dynametically when upload in ionic 4

Open
#240 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
606
Forks
874
PR merge metrics
No merged PRs in 30d

Description

hi, i am using Ionic 4 with angilar 7 in my project. currently i am facing difficulties on upload image. it works fine with static name like

```
let options: FileUploadOptions = {
fileKey: 'file',
fileName: 'name.jpg',
headers: {}
.....
}
```

it working fine. but i need dynamic name. so i updated accordingly

```
this.temp_image_name = new Date().getTime()+'.jpg';
this.temp_image_name = new Date().getTime()+'.jpg';
let options: FileUploadOptions = {
fileKey: 'file',
fileName: this.temp_image_name,
headers: {}
.....
}
```

but it not working and file name return empty. have any idea on this issue. Thanks

Contributor guide

Open the contributing guide

Research direction

Start with the FileUploadOptions usage shown in the issue and inspect how the plugin handles the fileName value during upload. No repository file, test, platform, or reproducible case is provided; done requires identifying the cause of the empty name and documenting or fixing a verified behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, javascript
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.