Readme
The key step was setting enctype="multipart/form-data"
on the <form>
element. If you skip that step, you'll only get the file's name on the server.
Currently (as of 4/14/24) this only works for small files (< 1mb). For larger files you get an error: {"statusCode":413,"error":"Payload Too Large","message":"request entity too large"}
.
A workaround is to upload to another service client-side, send the URL from that service to your Val Town server, and then fetch the file server-side (helper: @stevekrouse/uploadTo0x0).
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
stevekrouse-fileinputuploadexample.web.val.run
Updated: April 14, 2024