kemal v0.25.0 Release Notes
Release Date: 2018-11-04 // over 5 years ago-
👍 Crystal 0.27.0 support.
[breaking change] Added back
env.params.files
.Here's a fully working sample for reading a image file upload
image1
and saving it underpublic/uploads
.post "/upload" do |env| file = env.params.files["image1"].tmpfile file\_path = ::File.join [Kemal.config.public\_folder, "uploads/", file.filename]File.open(file\_path, "w") do |f| IO.copy(file, f)end"Upload ok"end
✅ To test
curl -F "image1=@/Users/serdar/Downloads/kemal.png" http://localhost:3000/upload
- 🐎 Cache HTTP routes to increase performance 🚀 #493