Back

[SOLVED] Storage Question

  • 0
  • Storage
  • Cloud
Drake
13 Sep, 2023, 04:18

That's meant for Appwrite 1.4 so it might not be a good idea to use that

TL;DR
The user had a storage question and was able to solve it with the help of Steven. They mentioned that the process takes too long and they want to optimize it. They also asked about the necessity of 'InputFile' and resolved it themselves by reading the Appwrite documentation. There was a discussion about the response body and its type, followed by a recommendation to update the Appwrite version. The user asked for clarification on how to view a stack trace and received a suggestion from Steven. They were advised to use the recommended version of the SDK for Appwrite Cloud.
ianmont
13 Sep, 2023, 04:19

the console doesn't show it, how can I see that?

ianmont
13 Sep, 2023, 04:20

I understand which one do you recommend to use with appwrite cloud?

Drake
13 Sep, 2023, 04:22

Appwrite cloud is on 1.1.2. You should read the readme for the SDK to see what version that version of the SDK is for

ianmont
13 Sep, 2023, 04:37

change my appwrite version to "node-appwrite": "^8.2.0" and i think i manage to show the stack trace:

ianmont
13 Sep, 2023, 04:37
ianmont
13 Sep, 2023, 04:37
ianmont
13 Sep, 2023, 04:39

i think is the line 185 of the code, which is the storage.createFile() function

Drake
13 Sep, 2023, 04:55

So node SDK version 8.2.0...you need to pass InputFile to create file

Drake
13 Sep, 2023, 04:57

What is response.body? What type?

Drake
13 Sep, 2023, 04:58

A buffer?

ianmont
13 Sep, 2023, 05:07

the response.body is a json string that looks like this:

ianmont
13 Sep, 2023, 05:08

Is that what you were referring to?

Drake
13 Sep, 2023, 05:15

So file.write(response.body) writes JSON to the file?

ianmont
13 Sep, 2023, 05:31

oh no the axios response.body is different, it looks like this in the console:

ianmont
13 Sep, 2023, 05:31

its looks like binary data of the file

Drake
13 Sep, 2023, 05:41

Could you maybe log typeof response.body?

Drake
13 Sep, 2023, 05:44

If you're using axios, I think you can get the response as a stream: https://masteringjs.io/tutorials/axios/response-body

ianmont
13 Sep, 2023, 05:49

thank you steven, I'll take a look about this

i was looking more into the appwrite docs and does the InputFile thing is it mandatory in order to work right?

ianmont
13 Sep, 2023, 06:12

It now works and the files are uploaded <:appwritecheers:892495536823861258>

the only thing is that it takes a long time and the timeout is executed earlier and raising it too much I don't think is a good idea, I will look for a way to optimize this function so that it doesn't take so long

ianmont
13 Sep, 2023, 06:12

for now thank you very much steven

Drake
13 Sep, 2023, 20:18

where are you located?

Drake
13 Sep, 2023, 20:18

[SOLVED] Storage Question

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