Say I have a bunch of URLs like this:
https://domain.com/foo/bar/2d9ec0354908e055acf372
From the URL I don't know what the extension is, and I don't have any other "frontend" information to tell me what kind of file it is.
But I do know what the title of the file is on the frontend. So I would like to just hardcode a title in when saving the file, and then append on whatever extension the real file has. So if the title of the file is "File A of N", I would like to call it "file-a-of-n" (I would just write that out). Then I would like the final result to be:
file-a-of-n.zip
Or whatever the extension ended up being. Maybe instead of .zip
this particular file was .tar.gz
, so it would end up being:
file-a-of-n.tar.gz
Whatever the extension ended up being, that's fine, want to append that to the file. But I don't want this:
2d9ec0354908e055acf372.zip
So wondering how to do this. Something with curl along the lines of:
curl -o file-a-of-n.(extension) https://domain.com/foo/bar/2d9ec0354908e055acf372
And the end result would be a file like:
file-a-of-n.zip
curl -o dwnld-file.X ...
, thenfile dwnld-file.X
to get downloaded file properties ?