The lib allows you to hand it an arbitrary file handle to upload and does not define the behavior of what happens if the given file is a directory.