While there are FTP clients for iOS, I haven’t found one that’s all that fast or nice to use. Instead, let’s look at what Blink Shell can do to transfer files from and to a server with the
scp command that is built in.
Preparing our Folder
The first step we’re going to take today is to login to our server and turn our folder into a zip archive file. The
scp implimentation in Blink doesn’t handle recursive transfers, we need to create a single file to transfer.
My default WordPress Ubuntu image didn’t have zip installed. If you don’t have it either you can use the following command to install what you need.
apt install zip
Then it’s a matter of selecting the folder you want to archive. Zip almost always confuses me the first time because it’s reversed to most of what I use when I’m transferring files, like
rsync, which is setup as $source then $destination. Zip is opposite that with the destination file being the first thing you enter then you follow it up with the source file or folder. If you’re trying to archive a folder make sure you use the recursive flag
-r or it won’t work. You can see all the flags for zip here
zip -r $destination.zip $source
I’ve picked the Better Search Replace plugin as my test today so my command is below.
zip -r better-search-replace.zip better-search-replace
That will generate my zip file and I need to take note of where it is on my server. For me the path is
Transferring the File
Before you can use
scp in Blink to transfer your file you need to log in to your server using ssh2. Evidently regular ssh in Blink loads an esdsa key which scp doesn’t recognize. To get the rsa key loaded you need to use ssh2 which scp does recognize.
Once you’ve done that it’s time to transfer our file with Blink using scp. My command looks like this.
scp cocoweststaging:/var/www/html/wp-content/plugins/better-search-replace.zip better-search-replace.zip
Now you can go to Files and unzip the folder to verify that it is in fact what you wanted to download.
A big note of awesomeness for Blink is that it will use your stored connection information to make connections to remote servers. Above see
cocoweststaging that’s the information for one of the client sites I’m working on currently. I don’t need to remember the IP address or login name, just the name I gave it when I stored it in Blink’s settings.
Transferring files with Blink over scp has been much faster than any of the FTP clients I’ve tried. Coda for iOS is downright slow, so slow it’s almost not worth if if you’re transferring more than a single file.