The most inefficient way to copy a file from the internet to your website is to download the file from the original location on the Internet to your PC, then upload it again via the Internet to your website. I’ve written this article to show you how to cut the time it takes to copy a file from the web to your site by more than 50%.
The technique basically copies the file directly from it’s original location on the internet into a folder on your website’s hosting server.
There is no need to;
– NO NEED to download the file to your PC
– NO NEED to FTP upload the file from your PC back onto the internet
To get going you’ll need ssh access to your webserver and ssh client software which you can access in two main ways
– If you are using a Windows machine, you’ll need PuTty http://www.chiark.greenend.org.uk/~sgtatham/putty/
– If you are a LINUX user then you can just run the ssh command from the shell.
1) Establish your ssh connection the web server which hosts your site
If you’re using Windows,
Run PuTTy and enter the server address and username then click open
If you’re using LINUX, start a linux command shell window and connect to your host using the command…
ssh < your-host-username >@< your-host-ip-address >
2) In the ssh client window, navigate to the folder you want to upload the file to
cd < site-root >/< target-folder >
3) Go to your web browser and copy the link to the file you wish to upload.
In Chrome you right click on the link and select copy link address from the pop up menu
4) In the ssh window, enter the following command
wget < link copied from previous step >
And that’s it, your file will be exactly where you want it without it touching your local hard drive. #
By not having to FTP the file to your machine also saves time because internet connection speeds between two servers are generally far quicker than the average home user’s broadband connection. With this method you are effectively replacing two slow transfers (download then upload via your PC) with one mighty quick transfer (wget) between two web servers.