c-3lab / dim

📦 dim: Manage the open data in your project like a package manager.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

$ 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.