icyleaf / halite

💎HTTP Requests Client with a chainable REST API, built-in sessions and middlewares.
MIT License
170 stars 13 forks source link

path/filename missmatch #16

Closed ghost closed 6 years ago

ghost commented 6 years ago

Found a missmatch:

Halite.post("http://127.0.0.1:3000/upload", form: {
  "username" => "Quincy",
  "avatar" => File.open("public/2.png")
})

were "public/2.png" becomes the filename, so, when trying to save this, i got:

Exception: Error opening file './data/uploads/public/2.png' with mode 'w': No such file or directory (Errno)

so "public/" is to much; it should only be "2.png"

and my path is correct with: './data/uploads/2.png' ;-)