2011-11-08 117 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