Download a file keeping original filename when final link is hidden

后端 未结 2 1310
甜味超标
甜味超标 2021-01-18 12:59

I need to download a file, save it in a folder while keeping the original filename from the website.

url <- \"http://www.seg-social.es/prdi00/idcplg?IdcSe         


        
2条回答
  •  暖寄归人
    2021-01-18 13:11

    I think basename() would be the simplest option https://www.rdocumentation.org/packages/base/versions/3.4.3/topics/basename

    e.g.

    download.file(url, basename(url))

提交回复
热议问题