HaschekSolutions / pictshare

:camera: PictShare is an open source image, mp4, pastebin hosting service with a simple resizing and upload API that you can host yourself. :rice_scene:
https://www.pictshare.net
Apache License 2.0
819 stars 123 forks source link

CORS issue when uploading via browser #139

Closed gevera closed 2 years ago

gevera commented 2 years ago

Is there an example of how to upload images via regular form data ?

I've been trying to use pictashare, hoewver getting errors when uploading

Access has been blocked from origin by CORS policy

geek-at commented 2 years ago

Are you having these problems on the demo page too? https://pictshare.net

or just on your own hosted instance?

gevera commented 2 years ago

I do have the same issur on https://pictshare.net/ and on my own instance of Pictashare in docker. Just for reference, i can upload images via Insomnia, Curl or Postman, but not from the browser

geek-at commented 2 years ago

oh wait you're not using the interface from pictshare, you try to directly upload from another website?

gevera commented 2 years ago

Thats correct. Using the API

geek-at commented 2 years ago

The API is meant to be used by a backend service not a browser since this will always trigger a CORS problem. Better upload from the backend. If you want to upload via the browser, use the built-in upload form of the landing page