Showing posts with label File management. Show all posts
Showing posts with label File management. Show all posts

Putting files into Blogger's root directory

This article explains the issues, and options, for putting a file into the "root directory" of your Blogger blog.


Turnips (Brassica rapa) 
from Wikimedia commons
Originally posted to Flickr 
by thebittenword.com.  
Licensed under the terms of 
the cc-by-2.0.
If you are using certain non-Google products to enhance your Blog, they will sometimes tell you to put a file into your root-directory.   They may even tell you to use an FTP  tool to do this.

Sometimes this happens when a product also gives you code to install into your blog , This approach is used when the code is written for websites in general rather than specifically to work with Blogger: putting useful files into a place relative to the root directory makes it a lot easier to move a website from a test-address to the live one, so is a common approach outside of Blogger.
Or maybe the other tool has been designed to verify that you do own the website in this way, rather than asking you to change the website code itself.


How to add a file to your blog's root directory

The short answer for Blogger users is "sorry, you cannot do this".

 The long answer is still no:  "there is no way to do this, but see the rest of this article for an explanation of why, and some suggested work-arounds."


Why not? Every other website tool lets me do this.

Home - cpg1.5.x demo 1287551599033
Posts:  Blogger's tool for managing
the content on our blogs
If you're clever, and have lots of time, you can make a website just using a text-editor like notpad, a graphics programme, and ftp software that lets you put the files into the right places on computer that's connected to the internet.

Tools like Dreamweaver take away a lot of the time-consuming work, and some of the need for cleverness.  But you still need to know a lot about the internet to do things in a way that makes a good website.

Content management systems make this easier still: they let a technically-minded person do the nuts-and-bolts work to make the website, and give authors / artists / editors / content-creators simpler-to-use tools that let them put "stuff" (ie content) into the website, without needing to worry about the details of how it works.

Blogger is a (very simple) website content-management system, it creates our web-pages for us based on data that we put into certain places. Administrators can set up and change templates, other people, eg authors simply make posts.

When we use Blogger, the main way that we change the data in our web-pages is using the Blogger software. 

Some items inside posts or gadgets can be changed using other software, eg Google Docs, provided they were were set up using that other software in the first place. But - key point - there is nothing in the way that Blogger is put together that means we need to access the base directory. So they don't let us do so.    And I doubt that this this will change anytime soon.


What to do instead

The options for getting around this restriction depend on how the file that you need to put into your root directory is intended to be used.


Installing code

If you have code to install into your blog, and a file to go with it, then you just need to
  1. Host the file somewhere else (maybe in your Picasa-web-album for the blog, if it's a picture)
  2. Change the code to point to the full path of where you have hosted the file, instead of the relative path used in the code
For example, here is the code for a button linking to my blog, with the picture in the root directory:
<div class="separator" style="clear: both; text-align: center;"> <a href="http://www.areyoublogger.blogspot.com" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"> <img border="0" src="//Logo.png" width="100" /></a></div>
To change this to use a specific location, I just add a file-path and the file-name of the picture wherever it is hosted.
<div class="separator" style="clear: both; text-align: center;"> <a href="http://www.areyoublogger.blogspot.com" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"> <img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh86rlBmDlB-Z4rZ3eWjsFzrfLPhtqSTJUBFplqXP-MFlM0_xYiunzCUGyaoqUmAiLqEEXnZ2NX6oxlcoa__9_Qw-bWci3qbQpjGlLzZB_pKxzd2km8ev_0DFjgS8FebcjzejwwmxxPUy2v/s320/Logo.png" width="100" /></a></div>

TIP: blogger's editor sometimes gets links mixed up, so it's important to start the filepath with "http://"




Verifying ownership

If someone wants to use a file's position to check that you control a website, then they will have code on their own website that looks for the file in your root directory.

You cannot change this code. And you cannot place the fie.

So you need to ask them for an alternative way to verify, that is suitable for people without root directory access.

 If they don't have any alternatives, try lobbying for this on their product support forum:  by not having alterantives, they are ensuring that Blogger users, among others, cannot use their service.

If the official answer is still "no", then you could also ask in other on-line forums if anyone has found any other work-arounds.


What other reasons have you found for installing files to your root directory?   
What work-arounds have worked for you?




An afterthought: what isn't recommended

Transclusion-iconI've recently seen someone suggest in a help forum that people with custom domains can put files into their blog's root directory by FTP'ing the files into place.

 This may be true, if the service that you are purchasing from your domain registrar includes file-hosting. But file hosting(*)
  1. Isn't necessary for a custom domain used in Blogger (since Google hosts our files for us), and
  2. Isn't available as part of the services when you buy a custom-domain through Blogger.

So it's not a general solution for most Blogger users, though it may work for some.

Initially I was a little sceptical of the idea: Blogger doesn't expect to see any files in our root directory, so I was concerned that it might do strange things if it found them there. But on reflection, I think there is probably a low risk of this happening, since the file-location is outside Blogger's control.

(*) To avoid any confusion, file hosting and DNS hosting are not the same thing. If you buy a custom domain for your blog from a registrar without going through Google/Blogger, then you do need to pay for DNS hosting, but do not need to buy file-hosting.



Related Articles

File hosts - places to store files used in your blog.

Picasa-web-albums: a quick introduction

How Blogger data is organised

Setting up a new administrator for your blog

Options for letting other people write in your blog

How to replace a file in Google Drive with a new version

This article is about how to update a file that you have loaded to Google drive. It only applies to files that have not been converted to Google Docs format - for example, PDF, Word, Excel etc files.


New versions vs new files in Google Docs

On a couple of my blogs, I provide files that people can download and use themselves.

When you share a file in this way, there are three main issues to consider:
  • Where to put the file
  • How people will find it
  • What format to use.


Today, Google Drive is the most obvious file hosting option for people using Blogger. (A file host is somewhere that you can put files which Blogger cannot upload - see File Hosting options for Blogger for more details and other alternatives.)

I thought a lot about the best format to use for these files: if I convert them to Google Drive (AKA Docs) format, they won't count against my file-storage quota, and everyone has access to Google Drive/Docs.  But not everyone has a Google account, or access to Docs at the time when they want to work on the file. And some people might struggle with using Word tables and formatting. So in the end, I decided to stick with MS Word and PDF formatted versions, for now at least.

And I tell people about these files by writing a blog post (eg "Table Quiz Answer Sheets") introducing the template, and put a link to each files in it (eg like the picture on the right for the PDF version - for info about how I did this see "Putting text and pictures side by side" ).

However I know that some people choose to note / bookmark / share / etc the location of the file, rather than the blog post. This is fine by me: the point of my blog is to provide tools, templates and advice. I ENsure that there is branding and a link to my blog on the downloaded files, so everyone who sees the printed version knows about my blog.   But I'm not fussed if some repeat-business goes directly to the files - I think they'll come back back to my site when they need advice or a different template.

But what happens if I want to change the file, for example to fix a typo that was missed originally, or to add a new feature?

If I just upload a new Word or PDF file to Google Docs then the links to this file will be different - even if it has the same name as a previously uploaded file.   People who go directly to the original file file will get the old (wrong) version - or even worse, I'll delete it and they will have a broken link.

However I've found that if I use Google Drive's tools for loading a new version of the file, then people with the link will always go directly to the latest version - and I can choose whether to keep the older versions inside Drive, or to delete them.


How to load a new version of a file to Google Drive


Log in to Google Drive, using the Google account that owns the document.


Navigate to the folder that the file is in.


Tick the document that you want to replace or update


Select More, from the navigation options bar above the list of documents


Go to Manage Revisions




Upload your updated version, using the Upload New Revision link:



If you want, delete the older non-current one using the "x" checkmark to the right hand side of the screen.




Job done:  anyone who goes to the existing file link will now get your most-recently-uploaded version of the document.



Troubleshooting

If there is no "Manage Revisions" option, then most probably the file is in native Google Docs format rather than another like Microsoft Word or PDF.   In this case, you need to edit it on-line.  Unfortunately I haven't found a way to temporarily leave the old, unedited, version available to any one who looks at the file before you have finished opening it.   This could be particularly annoying if you want to make a lot of changes -  in this case, it may be best to convert the file back to a downloadable format (Word, etc) and work on it locally before re-uploading and then copy-and-pasting te new contents back to your original file.



Can this be done with the Drive desktop software?

The short answer is: I don't know.

 I have multiple Google accounts, for different blogs, so I've decided that it's safest to always use the web-browser based tools to manage files in Drive, rather than try to work with different accounts on different areas of my local file store.

If you do know, please leave a comment below.




Other options?

I'm certain that there are othr tools in which it's easier to replace an existing verison of a file with a new one without changing the link to the file.    The following notes discuss the ones I've tried so far.


Google Sites

Originally I used "filing cabinet" pages in Google Sites to store the files which I make available. This has a couple of advantages:

If you upload a new file with the same name, then
  • The link does not change
  • The sharable link includes the original file-name, which makes it easier for me to be sure that I'm putting the right link into my blog posts.

However, Sites isn't Google's preferred way of managing documents now and I have a nasty feeling that one day it may go the same way as Google Pages, Reader, Picnik, etc.  So I decided a while ago to stop using Sites for this.



Related Articles:

File Hosting - places to store files that you use in your blog

Understandiing Google Accounts

Showing things side-by-side in Blogger