0
$ curl -T "index.html" -k --ftp-ssl -u "MYUSER@MYDOMAIN.COM" MYDOMAIN.COM
Enter host password for user 'MYUSER@MYDOMAIN.COM':


 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 57173    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>405 Method Not Allowed</title>
</head><body>
<h1>Method Not Allowed</h1>
<p>The requested method PUT is not allowed for the URL /index.html.</p>
<hr>
<address>Apache/2.2.16 Server at MYDOMAIN.COM Port 80</address>
</body></html>
100 57480  100   307  100 57173    284  52902  0:00:01  0:00:01 --:--:-- 53633

Also posted on Stack Overflow

1
  • 2
    Cross-posting is a no-no.
    – John T
    Jan 11, 2011 at 9:58

2 Answers 2

1

The problem is not @ (you don't need to escape it), it's that you haven't told curl to use FTP in the first place. Note that you're receiving a HTTP response from a HTTP server.

cURL takes URLs, and if it encounters a bare mydomain.com it adds http:// automatically. Use curl ... ftps://mydomain.com (which enables --ftp-ssl automatically, by the way).

1

i sniffed it with wireshark:

curl --ftp-ssl -T "FILE.TXT" -k -u "MYUSER@MYDOMAIN.COM:MYPASSWORD" "ftp://MYDOMAIN.COM"

and this one uses ftps! :P it works perfectly! solved :)

thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.