2011-11-08 116 views
1

當我登錄到這個SFTP服務器時,我使用客戶端,我被帶到一個特定的文件夾(/ home/blah /),我正在尋找的文件位於,我可以下載它curl文件沒有找到

當我運行在命令提示符下一個curl命令:捲曲 -u'用戶名:密碼「主機的/ home /胡說/ myfile.xml中」

我能夠連接到服務器,但該文件未找到。我想知道是否有一種方法可以指定我正在查找的文件所在的路徑......我不確定如何繼續。

< HTTP/1.1 404 Not Found 
    < Date: Tue, 08 Nov 2011 19:16:47 GMT 
    < Server: Apache/2.2.3 (Red Hat) 
    < Content-Length: 314 
    < Connection: close 
    < Content-Type: text/html; charset=iso-8859-1 
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> 
    <html><head> 
    <title>404 Not Found</title> 
    </head><body> 
    <h1>Not Found</h1> 
    <p>The requested URL /home/blah/myfile.xml was not found on this server.</p> 
    <hr> 

回答

1

curl默認使用HTTP。除非您將服務器上的文件放入網站的documentroot中,否則您將無法使用curl下載它 - curl僅限於抓取Web服務器配置爲提供的內容。

換句話說,即使你要求

/home/blah/myfile.xml 

通過捲曲,Web服務器本身會找一些其他位置,如

/home/sites/example.com/doc_root/home/blah/myfile.xml