Check if file exists on FTPS site using cURL

纵饮孤独 提交于 2019-12-11 12:40:35

问题


I am using the cURL app to download multiple csv files. I want to find a way to check if the file exists on the ftps site before kicking off the download. If it doesn't exist I would like to find a way for cURL to check again at regular intervals. I am trying to stick to using cURL commands for this I am really not good at .Net programming. Any help would be appreciated


回答1:


$ curl ftp://[host]/[path] --ssl --head

(you might also need -k)

--ssl: Try to use SSL/TLS for the connection

--head: When used on an FTP or FILE file, curl displays the file size and last modification time only

It will return an error if the file doesn't exist. It will not keep checking, it will only check once so you need to do the repeated checking using some scheduler/cron/script or whatever.



来源:https://stackoverflow.com/questions/5951649/check-if-file-exists-on-ftps-site-using-curl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!