This is a post dedicated to all of my fellow WordPress bloggers out there. Here is a scenario that happens to me frequently, especially when we’re out traveling or seeing the sights. How do you get photos from Android to WordPress? And more specifically, to the media area on your hosted WordPress blog? This post will provide you one way of accomplishing your goal.
Here’s the typical scenario: I find myself out on a tour, and I forgot, or didn’t bring my DSLR camera (stupid!), and I wind up taking pictures with the camera on my smartphone. The problem is when I get back home, and I have all those pictures that I want to upload onto my WordPress blog. Note that I’m not talking about creating a Post from my smartphone (there’s already a WordPress app for that). I just want to get the photos from my phone up to the Media area in my WordPress site.
What Will You Need?
This is more of a high-level description. I’m making the following assumptions in this post:
- You have a hosted WordPress (WP) installation;
- You have Administrator rights on the WP installation;
- You are familiar with adding Plugins and configuring them;
- You have the ability and know-how to access the filesystem of the server, be it Linux or Windows;
- You have an Android phone with connectivity to the Google Play Store (the same idea applies to iOS as well though);
- Overall technical familiarity with server side administration;
Now if your situation does not match those assumptions, don’t fret. If you have an IT person/technical person that you can leverage, the above things should make sense.
Create The Upload Directory
On the server side (Linux or Windows), you’ll need to login to your hosting provider and create a directory. This is normally done through the cPanel, or some sort of browser-based GUI. It’s a point and click interface that’s easy to use. There’s typically some sort of File Manager / File Management icon that can be used to create the directory. Or, if you’re comfortable with the command-line, you can do that as well. If you’re lost, or scratching your head, don’t sweat it. This is where you buy your Techie Person a beer, donut, or hotdog, and get them to help you.
Once you’re in the File Manager, you may need to select the directory you want to open. Select Home Directory, and click Go. Assuming you have root/admin access to the Home directory, you should see a bunch of files. You may or may not know what each of them does, but right now, look for the public_html directory. This is where we’ll create the upload directory.
Security Sidenote: There are definitely security implications to creating this upload directory. The specifics are beyond the scope of this post, but you should be aware of them. One of the biggest security concerns you may have is who is going to access (read and write) this directory. Ideally, you would have a specific user account that can only access this directory, and nothing else. If you are very concerned with this, talk to your Techie Person while you refill their beer.
Click the public_html directory, or if it’s not called that, look for something else that indicates “public”. Once there, click on the New Folder icon at the top left, and choose a name for your folder.
I chose the name wp-uploads just to keep consistent with the WP naming scheme, but it doesn’t really matter. All that matters is that you remember the name of the file, and where you created it. With the directory created, you can log out/close your cPanel.
Tell WordPress How To Access The Directory
On the WordPress side of things, you’ll need to install/configure a sweet little plugin called Add From Server (kudos to Dion Hulse). In your WP dashboard, hover over Plugins, and click Add New. In the text box, enter “Add From Server”, and click Search Plugins. The plugin should be the first in the list. Click Install Now, and the plugin is automatically downloaded and installed. Isn’t technology great!? Click the Activate Plugin, and it is now live.
Now it’s time to configure the plugin. Click on the Add From Server Options while viewing all of your installed plugins. You should see a screen similar to this:
Once again, there are security implications, but here is how I configured mine. The big item to note is the directory we created in the previous step is correctly entered. Note that this will path will be truncated in the next step, but I’ll point it out when we get there. For security purposes, I blanked out my Root Path.
Setting Up The Phone
Now that all of the server stuff is complete, it’s time to get the smartphone squared away. On your Android phone, open the Google Play Store app, and search for an FTP Client. The specific client that I use is AndFTP by LYSESOFT. It’s fully featured, and it’s free! I love free.
Install the app, and the first time you open it, you’ll need to configure it. Tap the Add button to create a new profile. The new profile will contain all of the relevant information that you’ll need to connect to your host (assuming that you have FTP running).
I’ll provide some example parameters, but obviously, you’ll need to use the correct information for your particular setup.
Hostname: myblog.com [your host without the "http://” or "www”]
Type: FTP (File Transfer Protocol) [try[try the other options if FTP does not work]
Port: [Don[Don’t change this unless required by your setup]
Username: joeuser [Thi[This is the server side account which may be different from your WordPress account]
Password: [You[Your super secret password that nobody (other than the NSA) knows]
Local dir: /storage/sdcard0/DCIM/Camera [Thi[This is where your pictures are stored. Your pictures may be located somewhere else, just point it to the correct directory. If you use the browse button, be aware that it’s looking for a directory, and it will not show the pictures in that directory, so don’t be surprised.]
Remote dir: /public_html/wp-uploads [Thi[This is the directory on the server side. It’s taken from the reference point of the user, so just tap the browse button, and assuming that the info you entered above is correct, you should be able to navigate to the directory you created.]
Resume: Enable resume support is checked
Tap the Save button, and a name will automatically be used (the hostname). Use that, or change it to something more user-friendly , and then Connect to the profile you just created. As you connect, you’ll see messages at the bottom of the screen which will let you know that you’ve connected to the correct server, using the correct username/password, with the correct Remote directory. If your Techie Person is still hanging around, it’s time for a refill.
Let’s Test It Out!
On your phone, go to the Gallery app, or whatever app you use to view pictures. Select one photo, or multi-select a few pictures. Tap the Share icon, and select the AndFTP app. You’ll see the AndFTP profile you just setup, and tap OK. Voila! The picture(s) will start uploading to your server! This is the key reason that I like AndFTP, as it provides intents for third-party applications. I highly recommend that you use a WiFi connection when uploading, and make sure you phone has enough juice to complete the upload.
Once the upload process is complete, tap OK.
Bringing The Pictures Into WordPress
Now that the pictures are on your host, it’s time to bring them into the WordPress Media area. Unfortunately, it’s not possible to just copy them directly to a directory of folder. Here’s where the Add From Server plugin comes in. From your WP dashboard, hover over Media, and select Add From Server.
All of those pictures you uploaded should be there. Select one or more of them, and click the Import button. The next window shows the standard interface when you’re adding media. That’s it! Your done.
There are a few things to remember:
- Security. As I stated, there are security implications that you should be aware of when working through this process.
- Your workflow may differ. You may want to do some minor editing (resize/crop) of the picture on your phone before uploading it. That’s OK. Do that, and then just upload the updated picture;
- The Add From Server plugin can also be used for bulk uploads. Check the website for more details;
- You don’t have to upload just pictures. You can upload videos as well;
- You can create multiple AndFTP profiles for photos, video, or any other file type;
- The files that you upload to your directory aren’t automatically deleted. You’ll need to manually delete them. Just use the File Manager that’s part of the cPanel;
- I mentioned it earlier, but I recommend that you use a WiFi connection to upload the pictures. You can easily burn through your data plan otherwise;
- If you’re not cropping or resizing the files before upload, the file size can be quite large. This makes for slow uploads. WordPress does provide some basic photo editing that can be done on the server side to reduce the size of the pictures that you’ll reference in your Posts.
I’m interested in feedback and/or suggestions. It would be nice if there was a single app that just did everything, but I haven’t found one yet. Anyway, the workflow isn’t too bad. I’ll be happy to assist those that have questions, or need a bit more help.