Skip to content
Back

getting error for Image preview

  • 0
  • Flutter
Wiseman
21 Mar, 2025, 14:01
TypeScript
                    try {

                      await appwriteService.init();

                      // Create a signed URL that includes authentication
                      final result = await appwriteService.storage.getFilePreview(
                        bucketId: "patient_profile_images",
                        fileId: "67d96a039e2087bf7399",
                      );

                      debugPrint('🌐 AppwriteService: Result: $result');

                    } catch (e) {
                      debugPrint('❌ AppwriteService $e');
                    }
                  }, child: Text("Get Image preview ")),```
TL;DR
Developers are encountering an error when trying to get a file preview in Flutter, as the function returns binary data instead of signed URLs. The error message shows binary image data. The provided code snippet doesn't contain any obvious issues.
Wiseman
21 Mar, 2025, 14:03

error flutter: 🌐 AppwriteService: Result: [255, 216, 255, 224, 0, 16, 74, 70, 73, 70, 0, 1, 1, 1, 0, 72, 0, 72, 0, 0, 255, 219, 0, 67, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 255, 219, 0, 67, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 255, 192, 0,

Wiseman
21 Mar, 2025, 14:08

getting binary data ?

Steven
21 Mar, 2025, 14:41

Get file preview doesn't create a signed URL. In flutter, it returns the bytes for the file

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more