Back

[CLOSED] Convert blob into InputFile?

  • 0
  • Functions
  • Storage
whataboutno13
4 Sep, 2023, 15:46

Hi there, I am trying to implement a function that stores a blob in the file system. Since my function is running on dart_appwrite 7.1.0 I have to convert the blob into a InputFile. How can I do that?

TL;DR
The user wants to convert a blob into an InputFile in Dart. They are running locally and are sending the file from an Angular web frontend. One user mentions that sending a file as input to the Appwrite function may be problematic due to a limit of 8k characters. It is recommended to upload the files with the Storage API instead. The solution provided is to use the Storage API to upload the file and then pass the resulting file ID as an argument to the function.
whataboutno13
4 Sep, 2023, 15:49

So basically the question is how to convert from blob into List<int>

Drake
4 Sep, 2023, 18:10

blob? I don't recall there being any blob in dart 🧐 What's your code? where is your file coming from?

whataboutno13
5 Sep, 2023, 07:36

My File is coming from an Angular Web Frontend. The File can be send as Blob or File and I cannot wrap my head around it how I could handle these Inputs in my dart function.

Drake
5 Sep, 2023, 18:41

Sorry, how is it getting into the dart function? how are you sending it from Angular?

whataboutno13
5 Sep, 2023, 19:09

Yes exactly. I am sending it from angular to the function.

Drake
5 Sep, 2023, 19:19

Are you running on cloud? I don't really recommend sending a file as input to Appwrite function because data param is limited to 8k characters 🧐

whataboutno13
6 Sep, 2023, 07:15

No I am running locally. Ok the limit of 8k chars could be a problem. Seems like I first have to upload the files with the Storage API. Thanks @Steven !

whataboutno13
12 Sep, 2023, 09:02

[CLOSED] Convert blob into InputFile?

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