fluttercommunity / fluttercommunity/flutter_downloader

after downloading pdf it is not opening getting error "can not display pdf (label.pdf is of invalid format)"

Open
#579 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
940
Forks
561
Avg merge
1h 18m
Merged PRs (30d)
1

Description

Below is how i am requesting the pdf download i am not directly putting pdf link i am just giving the url which return pdf download

Pdf is getting downloaded but it is not the correct one. Please help me in this

_setHeaders() => {
'Authorization' : 'Bearer $token',
'Content-Type' : "application/pdf",
'Accept' : '*/*',
'Content-disposition': "attachment",

};
final id = await FlutterDownloader.enqueue(
url: "https://domain.com/api/v1/label_generate/24704",
headers: _setHeaders(),
savedDir: "/storage/emulated/0/Download",
fileName: "label.pdf",

showNotification: true,
openFileFromNotification: true,

);

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the FlutterDownloader.enqueue request to https://domain.com/api/v1/label_generate/24704 with the shown headers and inspect the downloaded label.pdf. Confirm whether the saved file contains a valid PDF response and document the cause or required request handling so the downloaded label opens successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.