plutov / formulosity

Self-hosted Surveys as Code platform.
https://formulosity.vercel.app
MIT License
181 stars 20 forks source link

New question type: file upload #8

Closed plutov closed 1 month ago

plutov commented 3 months ago

Question to upload a file, which is then uploaded to specified docker volume.

jacksonwun commented 1 month ago

Hi, Can i work on this issue?

  1. Are there any specific file types or size limits for the uploaded files? Should they be added in validation?
  2. Do we need multiple volumes?
divyansh-prk commented 1 month ago

hi i want to work on this issue

plutov commented 1 month ago

@jacksonwun let's start with one volume for the data. And add optional validation in Yaml. for example:

type: file
validation:
  max_size_bytes: 123*123
  formats:
    - .jpg,
    - .jpeg
...
jacksonwun commented 1 month ago

It looks like yaml don't support formula. We can do string if this is better


type: file
validation:
  max_size_bytes: '123 * 123'
  formats:
    - .jpg,
    - .jpeg
plutov commented 1 month ago

@jacksonwun I think we can omit multiplication. Maybe even make it simpler and just provide an integer in megabytes.

jacksonwun commented 1 month ago

@plutov I see, just corrected to multiplication in the PR.

plutov commented 1 month ago

done! Thanks @jacksonwun