ciscoheat / sveltekit-superforms

Making SvelteKit forms a pleasure to use!
https://superforms.rocks
MIT License
2.26k stars 67 forks source link

Returning an empty form data when uploading some file #446

Closed magiceupho closed 5 months ago

magiceupho commented 5 months ago

Hi, I've a form with a file input not required, the form is submitted correctly when I don't upload file, but return 400 and form data empty when I upload file. This happens only on production app, and not with all files... I don't understand why some files do not cause the error.

Here is the return ok the action:

{
  id: 'n9hrob',
  valid: false,
  posted: false,
  errors: {},
  data:
  {
    id: undefined,
    word: '',
    isActive: false,
    imageFile: undefined,
    image: null,
    gifFile: undefined,
    gif: null,
    audioFile: undefined,
    audio: null,
    tags: null
  },
  constraints: {
    id: { min: 1 },
    word: { minlength: 1, required: true },
    isActive: { required: true },
    image: { low: [Object], full: [Object] },
    tags: { label: [Object], value: [Object] }
  },
  shape: { image: {}, tags: {} }
}

Here is a screen of SuperDebug before submit: 2024-06-25 Arc 000030@2x

These is the screen of SuperDebug after submit: 2024-06-25 Arc 000028@2x

Can you help me please ?

Regards, magiceupho

magiceupho commented 5 months ago

Hi,

After several tests and research, I found that it comes from node adapter's BODY_SIZE_LIMIT env variable. I tested with BODY_SIZE_LIMIT=Infinity and it works well. I just need to determine the max size properly.

I hope this could help another people.

Regards, magiceupho