Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How upload folder by FTP using cURL?

I need to create FTP-uploader, i am using pycurl and python, but i dont know how to make folder with cURL on ftp's host. Help me please.

like image 881
kalombo Avatar asked Nov 09 '10 08:11

kalombo


People also ask

How do I upload a folder using curl?

Send the data using curl's –d or –data option. To execute a CURL file upload, you need to use the –d command-line option and begin data with the @ symbol. The file's name should come after the data with @ symbol so CURL can read it and send it to the server.

Can we transfer a folder in FTP?

To transfer files to another computer, open an FTP connection to that computer. To move files from the current directory of your computer, use the mput command. The asterisk ( * ) is a wildcard that tells FTP to match all files starting with my . You can also use a question mark ( ? ) to match a single letter.

Does curl work with FTP?

DESCRIPTION. curl is a tool to transfer data from or to a server, using one of the supported protocols (HTTP, HTTPS, FTP, FTPS, GOPHER, DICT, TELNET, LDAP or FILE). The command is designed to work without user interaction.


1 Answers

You can use the curl option while uploading a file : --ftp-create-dirs

  • http://curl.haxx.se/docs/manpage.html#--ftp-create-dirs

Ex:

curl --ftp-create-dirs -T uploadfilename -u username:password ftp://sitename.com/directory/myfile
like image 140
pyfunc Avatar answered Sep 23 '22 02:09

pyfunc