PricingBlog

Working with Files

  • stockton_f-1175476954762334238

    Stockton

    2 years ago

    How can I have a form that also takes a file upload (images) and sends that file to Supabase storage?

    I’m getting very turned around on this.

    Thank you!
  • erikbeus-1176083525607378944

    Erik Beuschau

    2 years ago

  • stockton_f-1176178540929101904

    Stockton

    2 years ago

    Oh snap!!! I should search more 😊

    That's pretty funny that it's the EXACT use-case I had as well.

    Thanks for reading my mind many months ago.
    😅1
  • stockton_f-1186423489075355658

    Stockton

    2 years ago

    @Erik Beuschau I'm having the darndest time getting this to work.

    Attached is a quick video if you spot anything I could be doing wrong...

    One other note, the request header for the upload file request was sent as application/json even though I specified multipart/form-data in the api 🤷‍♂️
    1186423487762546819-image.png
  • erikbeus-1186576119827267675

    Erik Beuschau

    2 years ago

    Could you try unchecking the "Proxy" setting for the actual "Upload file" API request?
  • stockton_f-1186698204830498937

    Stockton

    2 years ago

    @Erik Beuschau I still get the same result. Mime type not supported 😦
  • And the content type is still application/json
  • erikbeus-1186709887279968367

    Erik Beuschau

    2 years ago

    I see. Strange. Could you invite me to your project? erik@toddle.dev
  • stockton_f-1186713394460491857

    Stockton

    2 years ago

    Invite sent 🙌
    👍1
  • I might have some lockdowns happening if you’re not logged in. Let me know if that’s the case
  • erikbeus-1186940239843971132

    Erik Beuschau

    2 years ago

    I sent you a DM 👍
  • erikbeus-1187838814207611032

    Erik Beuschau

    2 years ago

    For others who might be interested: it turned out to be a typo in the content-type header value for the upload file API request. Eventually, we should allow picking standard values from a dropdown/autocomplete field for header keys/values 🤞
  • stockton_f-1187840297225420901

    Stockton

    2 years ago

    @Erik Beuschau is the best! Thank you so much!! 🫢