fix upload file example in changelog (#504)

This commit is contained in:
Anton Maminov 2018-11-05 22:55:20 +02:00 committed by Serdar Dogruyol
parent 22a2a69d65
commit 4ccea8d6a1

View file

@ -9,16 +9,16 @@
Here's a fully working sample for reading a image file upload `image1` and saving it under `public/uploads`.
```crystal
```crystal
post "/upload" do |env|
file = env.params.files["image1"].tmpfile
file_path = ::File.join [Kemal.config.public_folder, "uploads/", file.filename]
file = env.params.files["image1"].tempfile
file_path = ::File.join [Kemal.config.public_folder, "uploads/", File.basename(file.path)]
File.open(file_path, "w") do |f|
IO.copy(file, f)
end
"Upload ok"
end
```
```
To test