How to download/upload files through a ftp proxy server with"curl"

Write your "How To" regarding anything you are comfortable with and you feel it will help the forum members.

NOTE :: All threads started here will appear only after the approval from Administrator
Post Reply
anish
Posts: 353
Joined: Fri Apr 27, 2007 12:34 pm
Contact:

How to download/upload files through a ftp proxy server with"curl"

Post by anish »

This help is for linux machines behind a FTP proxy.. (Note: Squid is not a true FTP Proxy server)

Say the proxy server is squid configured to be running on ' 192.168.0.10' Port '3128'
then some of the things we can do..

* List Files On FTP Server

curl --proxy 192.168.0.10:3128 [url]ftp://xyz:mypass@sharethespace.com:21[/url]

* Download a file

curl -o STSServerInstaller.exe --proxy 192.168.0.10:3128 [url]ftp://xyz:mypass@sharethespace.com:21/STSServerInstaller.exe[/url]

* Upload multiple files to the ftp server..

curl --upload-file "{rarlinux-3.6.0.tar.gz,vmlogo.xpm}" --verbose --proxy 192.168.0.10:3128 [url]ftp://xyz:mypass@sharethespace.com:21[/url]

Note: We are uploading two files ie. rarlinux-3.6.0.tar.gz and vmlogo.xpm, similarly we can state more files, with a comma seperated list.

* We can also give the username/ password in options which is much safer than using it on the URL.

curl --upload-file "{rarlinux-3.6.0.tar.gz ,vmlogo.xpm}" --verbose --proxy 192.168.0.10:3128 -u xyz:mypass [url]ftp://sharethespace.com:21[/url]

curl -o STSServerInstaller.exe --proxy 192.168.0.10:3128 -u xyz:mypass [url]ftp://sharethespace.com:21/STSServerInstaller.exe[/url]

curl --proxy 192.168.0.10:3128 xyz:mypass [url]ftp://sharethespace.com:21/path/to/file[/url]


CURL is a free GPL'ed Utility available on various platforms. in linux it comes by default.. in case its not there, please visit http://curl.****.se/download.html and download the version required for your platform. Windows Binary download is here

Note: The normal FTP client (Shell or ftp on dos prompt) does not work with ftp proxy servers.

CURL is a free GPL'ed Utility available on various platforms. in linux it comes by default.. in case its not there, please visit http://curl.****.se/download.html and download the version required for your platform. Windows Binary download is here

Note: The normal FTP client (Shell or ftp on dos prompt) does not work with ftp proxy servers.


SHAdmin
Posts: 2095
Joined: Sat Dec 18, 2004 11:28 am
Contact:

Post by SHAdmin »

Thank you for sharing the usefull 'How To' with the community members. You have been credited 25 points for sharing it.
Post Reply