i uploaded pdf same as i did with uplaoding images and now i wanna fetch it and display it but i only have the link of that file which is - $APPWRITE_ENDPOINTS/storage/buckets/$APPWRITE_FILES_BUCKET/files/$fileId/view?project=$APPWRITE_PROJECT_ID&mode=admin
And what's the issue?
I mean how can i display that pdf file
I tried using a pdfview package but it needs filepath which is just showing blank screen if i am providing the link to that filepath
Have you tried using the Get File for Download instead of the Get File for View method?
Isn’t there any way so that the user can see the file before downloading it
Viewing and Downloading is basically the same thing. Even in Appwrite, the only difference difference is that when you use download, the response comes with a Content-Disposition: attachment header, which instructs the browser to download the file
Okay i will try to do that
Mind if I ask which package you're using for the pdf?
flutterpdfview
i am providing link to PDFView CarouselSlider(
items: fileLinks.map((link) {
return Container(
width: MediaQuery.of(context).size.width,
margin: const EdgeInsets.all(10),
child: PDFView(
filePath: link,
),
);
}).toList(),
options: CarouselOptions(height: 400, enableInfiniteScroll: false),
);
and i am sure that there is nothing wrong with the link
btw it's best to use 3 backticks for multi line code
There's not much else on the Appwrite side for this. If your library requires a file path, you must download and supply a file path
Recommended threads
- listRows result parsing issue
I'm using Appwrite Dart SDK "24.2.0". When I perform a listRows call in dart, I have this reponse in JSON: in " Future<models.RowList> listRows()" { "total" :...
- Broken Flutter SDK >=24.1.0
Row.fromMap now does: ``` data: Map<String, dynamic>.from(map["data"] ?? {}) ``` But Appwrite Cloud TablesDB row responses return custom row columns flattene...
- Flutter OAuth2 does not attach Google se...
Hi Appwrite team, I’m using Appwrite Auth in a Flutter mobile app and trying to upgrade an anonymous user to Google OAuth. Docs say that if there is already a...