eu cheirei com wireshark:
curl --ftp-ssl -T "FILE.TXT" -k -u "[email protected]: MYPASSWORD" " ftp: // MYDOMAIN. COM "
e este usa ftps! : P funciona perfeitamente! resolvido:)
obrigado!
$ curl -T "index.html" -k --ftp-ssl -u "[email protected]" MYDOMAIN.COM
Enter host password for user '[email protected]':
% 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
Também postado em estouro de pilha
eu cheirei com wireshark:
curl --ftp-ssl -T "FILE.TXT" -k -u "[email protected]: MYPASSWORD" " ftp: // MYDOMAIN. COM "
e este usa ftps! : P funciona perfeitamente! resolvido:)
obrigado!
O problema não é @
(você não precisa escapar), é que você não disse a curl
para usar o FTP em primeiro lugar. Observe que você está recebendo uma resposta HTTP de um servidor HTTP.
O cURL usa URLs e, se encontrar um mydomain.com
, ele adicionará http://
automaticamente. Use curl ... ftps://mydomain.com
(que ativa --ftp-ssl
automaticamente, a propósito).