Back

Inputfile vs CreateFile?

  • 0
  • Functions
brando
25 Oct, 2024, 21:06

Tryna upload plots via cloud functions to my storage bucket but can’t manage to do so. InputFile supposedly is no longer supported after 7.0.0 so I’m having trouble using that. Thoughts?

TL;DR
Developers are discussing the replacement for InputFile after version 7.0.0. A suggested solution is to use the following code snippet when handling file uploads: ```python response = storage.create_file( bucket_id=‘ ‘ file_id=‘unique()’ file=InputFile.from_path(file_path) ) ``` For handling file uploads, it's recommended to import from `node-appwrite/file` in the node SDK.
Steven
25 Oct, 2024, 21:15

I'm assuming you're talking about the node SDK. can you try importing from node-appwrite/file?

brando
25 Oct, 2024, 21:19

No, for python

brando
25 Oct, 2024, 21:19

I’m trying to handle file uploads.

brando
25 Oct, 2024, 21:21

response = storage.create_file( bucket_id=‘ ‘ file_id=‘unique()’ file=InputFile.from_path(file_path) )

Steven
25 Oct, 2024, 21:36

FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting).

brando
25 Oct, 2024, 21:36

I checked your docs btw

brando
25 Oct, 2024, 21:36

It’s outdated

brando
25 Oct, 2024, 21:37

I am using the same thing and idk why it won’t import

Steven
25 Oct, 2024, 21:37

oh...ya...there are some new changes coming-ish with files

brando
25 Oct, 2024, 21:37

what is the current replacement for InputFile?

brando
25 Oct, 2024, 21:37

In ver 7.0.0

Steven
25 Oct, 2024, 21:38

hmmmm perhaps you should use version 6.1.0 🧐

brando
25 Oct, 2024, 21:38

Let me try

brando
25 Oct, 2024, 21:43

Hmm… I think it worked lol

brando
25 Oct, 2024, 21:43

Ty ty 😄

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