Skip to content
Back

image upload thru https

  • 0
  • Functions
  • Storage
oferardi
10 May, 2023, 21:17

Hi, is it possible to upload an image to appwrite thru https?

I need to upload images from ip camera to appwrite backet.

This is an example with Google cloud - https://github.com/AxisCommunications/acap-integration-examples-gcp/blob/main/images-to-google-cloud-storage/README.md.

TL;DR
User is asking if it's possible to upload an image to Appwrite through HTTPS. They provide an example using AWS and ask if similar functionality is available with Appwrite. Another user suggests using Appwrite's REST API or calling the REST APIs directly. The original user asks about using HTTPS to upload images from an IP camera to an Appwrite bucket. No solution is provided in the thread.
Drake
10 May, 2023, 21:20

uhh...I'm not really sure what you mean...HTTPS is just a transport protocol. Are you asking about how to use the REST API directly?

oferardi
10 May, 2023, 21:38

Hi the camera can send the image with HTTP Post.

This is an example with aws below.

Can I have same functionality with appwrite? I'm which way? Probably I can't use rest api directly with the camera.

https://www.axis.com/developer-community/event-based-image-upload-to-aws-s3

Drake
10 May, 2023, 21:40

a REST API takes an HTTP request and returns a response so that's what you're probably looking for. All of Appwrite's SDKs interact with Appwrite's REST (or realtime) APIs. If you can't use the SDK, you can call the REST APIs directly.

See https://appwrite.io/docs/rest and https://appwrite.io/docs/client/storage?sdk=rest-default#storageCreateFile

oferardi
10 May, 2023, 21:46

I can use this. <img src="https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID]">

But the issue will be the authentication.. I can pass parameters only as cgi parameters.

Drake
10 May, 2023, 21:49

that is for reading a file. not creating a file.

I don't know how cgi paramters works

Drake
10 May, 2023, 21:50

what is that system? what other option do you have besides S3 recipient?

oferardi
10 May, 2023, 21:55

The s3 is only a text caption.. the camera can only post image with https so to upload it to aws you need to have lampda (cloud function).

This is how it's done with aws:

Axis camera to AWS S3 we instead send them to an API Gateway. The API Gateway delegates authorization to a Lambda authorizer that compares the provided access token to an access token stored in Secrets Manager. If the provided access token is deemed valid the API Gateway forwards the request to a Lambda function that proceeds with uploading the provided image to an AWS S3 bucket.

Drake
10 May, 2023, 22:04

i took a look at axis' documentation and it doesn't look like they give very many options for sending the request. as such, you'll probably need to do something similar to craft the request into one that works with appwrite

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