SupabaseS
Supabase3y ago
Ares

failing upload to storage ssr

Hi, I'm trying to upload images to storage through the backend, previously I was doing it from the frontend because I only had to upload one image (profile picture).

now I need to upload image(s) while submitting form data. something like an advert with a title, description and a couple of images (like ebay).

I'm using sveltekit and trying to submit through form actions as.

When console.log() I can see that the fileBody is being sent to the backend.

I'm getting this error while everything else is upserting correctly into the db. image paths getting saved into db, but no images in storage.
node:internal/deps/undici/undici:11576
    Error.captureStackTrace(err, this);
          ^

TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11576:11) {
  cause: Error: read ECONNRESET
      at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) {
    errno: -54,
    code: 'ECONNRESET',
    syscall: 'read'
  }
}


file body
file File {
  size: 255064,
  type: 'image/webp',
  name: 'buchhalter_profile.webp',
  lastModified: 1702116668728
}
Was this page helpful?