Michelle
Michelle

Reputation: 51

curl file not found

When I log into this SFTP server I was given using a client, I am taken to a specific folder (/home/blah/) where the file I'm looking for is located, and I can download it

When I ran a curl command from the command prompt: curl -u 'user:pass' 'host/home/blah/myfile.xml'

I am able to connect to the server, but the file is not found. I was wondering if there's a way I can specify the path where the file i'm looking for is located... I'm not sure how to go further.

    < 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>

Upvotes: 1

Views: 3705

Answers (1)

Marc B
Marc B

Reputation: 360662

curl uses HTTP by default. Unless the file you sftp'd to the server has been placed into a website's documentroot, you won't be able to use curl to download it - curl will be restricted to grabbing only what the webserver's been configured to serve up.

In other words, even though you've requested

/home/blah/myfile.xml

via CURL, the webserver itself will be looking for some other location, like

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

Upvotes: 1

Related Questions