appwrite / sdk-for-web

[READ-ONLY] Official Appwrite Web SDK ๐Ÿงก
https://appwrite.io
BSD 3-Clause "New" or "Revised" License
271 stars 58 forks source link

๐Ÿ› Bug Report: storage.createFile() looses mimeType and stops at 0 bytes when uploading #61

Closed trashcoder closed 9 months ago

trashcoder commented 11 months ago

๐Ÿ‘Ÿ Reproduction steps

When using sdk-for-web for react-native createFile looses the mimetype and stops at 0 bytes when uploading a file

const blob = new Blob(['Hello World'], { type: 'plain/text', } as BlobOptions); //@ts-ignore const file = new File([blob], fileName, {type: blob.type}); const response = await storage.createFile(BUCKET_ID, ID.unique(), file);

Bildschirmfoto 2023-07-03 um 23 23 00

The same behaviour is when i upload an image from rn-image-picker.

๐Ÿ‘ Expected behavior

it should upload a file and keeping the mimetype.

๐Ÿ‘Ž Actual Behavior

it stops at 0 bytes and looses the mimeType.

๐ŸŽฒ Appwrite version

Different version (specify in environment)

๐Ÿ’ป Operating system

Linux

๐Ÿงฑ Your Environment

Appwrite Client Version: 11.0.0 Appwrite Server: 1.3.7 React-Native Version: 0.71.11

๐Ÿ‘€ Have you spent some time to check if this issue has been raised before?

๐Ÿข Have you read the Code of Conduct?

stnguyen90 commented 9 months ago

@trashcoder, thanks for creating this issue! ๐Ÿ™๐Ÿผ Unfortunately, createFile doesn't work with react-native. See https://github.com/appwrite/sdk-for-web/issues/27