dim icon indicating copy to clipboard operation
dim copied to clipboard

Can't download file when specify URL without filename

Open Sheile opened this issue 2 years ago • 0 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.

Sheile avatar Aug 05 '22 16:08 Sheile