mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
fix upload file example in changelog (#504)
This commit is contained in:
parent
22a2a69d65
commit
4ccea8d6a1
1 changed files with 4 additions and 4 deletions
|
@ -11,8 +11,8 @@ Here's a fully working sample for reading a image file upload `image1` and savin
|
|||
|
||||
```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
|
||||
|
|
Loading…
Reference in a new issue