Can't download file when specify URL without filename
Sheile opened this issue · comments
Currently, downloaded file is created at data_files/{name}/{filename}
.
If URL is matched with following patterns, current logic can't get filename and occur an error.
- domain only (e.g. https://www.example.com )
- trailing with slash (e.g. https://www.example.com/dummy/ )
$ dim install https://www.example.com -n example1
Failed to install. Is a directory (os error 21), open './data_files/example1/'
Proposals:
Use Content-Disposition
response header to determine filename.
And fallback to use --name
option as filename if don't serve it.