Skip to content

Releases: kemalcr/kemal

v0.19.0

09 May 07:47
Compare
Choose a tag to compare
Format

v0.18.3

07 Mar 16:52
Compare
Choose a tag to compare
  • Remove Gzip::Header monkey patch since it's fixed in Crystal 0.21.1.

v0.18.2

24 Feb 07:30
Compare
Choose a tag to compare

v0.18.1

21 Feb 19:28
Compare
Choose a tag to compare
  • Crystal 0.21.0 support
  • Drop multipart.cr dependency. multipart support is now built-into Crystal <3
  • Since Crystal 0.21.0 comes built-in with multipart there are some improvements and deprecations.

meta has been removed from FileUpload and it has the following properties

  • tmpfile: This is temporary file for file upload. Useful for saving the upload file.
  • filename: File name of the file upload. (logo.png, images.zip e.g)
  • headers: Headers for the file upload.
  • creation_time: Creation time of the file upload.
  • modification_time: Last Modification time of the file upload.
  • read_time: Read time of the file upload.
  • size: Size of the file upload.

v0.18.0

11 Feb 13:55
Compare
Choose a tag to compare
  • Simpler file upload. File uploads can now be accessed from HTTP::Server::Context like env.params.files["filename"].

env.params.files["filename"] has 5 methods

  • tmpfile: This is temporary file for file upload. Useful for saving the upload file.
  • tmpfile_path: File path of tmpfile.
  • filename: File name of the file upload. (logo.png, images.zip e.g)
  • meta: Meta information for the file upload.
  • headers: Headers for the file upload.

Here's a fully working sample for reading a image file upload image1 and saving it under public/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

v0.17.5

08 Jan 08:55
Compare
Choose a tag to compare

v0.17.4

24 Dec 11:46
Compare
Choose a tag to compare

v0.17.3

03 Dec 14:38
Compare
Choose a tag to compare

v0.17.2

25 Nov 14:41
Compare
Choose a tag to compare
  • Use body.gets_to_end for parse_json. Fixes #260.
  • Update Radix to 0.3.5 and lock pessimistically. (thanks @luislavena)

v0.17.1

24 Nov 09:31
Compare
Choose a tag to compare

This is a bug fix release with the following changes

  • Treat HTTP::Request body as an IO. Fixes #257