Skip to content
Back

Appwrite Storage without authentication

  • 1
  • Web
  • Storage
Omnificent
28 Mar, 2023, 11:31

Hey guys, I've been using Appwrite quite a bit for the database and realtime features but not much in storage.

However, I'm currently working on a project where I would only like to use Appwrite for the Storage bucket similar to S3.

Would need to know if this is possible. Would need two things.

  • Upload image from the Web SDK without any user from Appwrite
  • Retrieve image URL from Server using nodeJS SDK and pass a valid link to the frontend

Any help is welcome. Thanks in advance!

TL;DR
You can use Appwrite's Storage bucket without authentication. To upload an image from the Web SDK, update the permission for your bucket to allow any role to upload. If you encounter the "current user is not authorized" error, update the bucket permission. To retrieve an image URL from the server using the Node.js SDK, create a new instance of Appwrite and use the Storage API to get the file download URL, then pass it to the frontend.
Arif Qayoom
28 Mar, 2023, 11:55

Sure thing!

You can use Appwrite for the storage bucket and achieve the following:

  1. To upload an image from the Web SDK, create a new instance of Appwrite, set up a file object and use the Storage API to upload the file.
  2. To retrieve an image URL from the server using the nodeJS SDK, create a new instance of Appwrite, use the Storage API to get the file download URL and pass it to the frontend.
Omnificent
28 Mar, 2023, 14:08

Hey thanks for the reply.

So it's fine if I don't have users on Appwrite but use the Web SDK to upload the image and the Server NodeJS SDK to access the image?

Omnificent
28 Mar, 2023, 14:35

Just to add on. If I try to use the Web SDK to upload files, I get the following error

AppwriteException: The current user is not authorized to perform the requested action.

AndrewIAm
28 Mar, 2023, 15:30

Probably you should set permission for your bucket for any role

Arif Qayoom
28 Mar, 2023, 23:53

@Omnificent Yeah @AndrewIAm Cleared that You may need To update permission for your bucket To (Any) So any One can Upload in it

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