File Manager Plugin
File Manager Plugin
About File Manager Plugin
The File Manager Plugin enables users to upload and download files between their local machine and the web server. In order to better understand how to use this tool, let's take a look at how Hemingway stores files.
When you create a web in Hemingway, it creates a folder for the web using the Web Name (removing spaces and any other strange characters). Inside the folder, Hemingway stores all the files for viewing the web. There is also a Staging folder stored there, which contains any files uploaded to the web, but not yet posted to the web via the Build Web command. Also, any style changes made to a template CSS file are put in the Staging folder as well.
When a Build Web command is issued, all .HTM and CSS files are removed from the web folder. Hemingway then checks for images and files referenced in the database. It keeps those already in the database (stored as Item Images and Item Files and Web Settings Images) and deletes all other files. This 'cleans' up the folder each time a build is done. Next, the new HTM pages are built and copied to the web folder along with the CSS file in the Staging folder. (Tip: if you change the CSS file, you can use File Manager to upload it as it will also copy it to the staging folder.)
So, if files are deleted each time a 'Build Web' is issued, then how to store 'other' files on the web server? Two ways. First, you make sure the file is referenced in the database as an Item File or Image. Second, you can manually upload the file using the File Manager Plugin, and make make sure it's named appropriately.
Naming Conventions
In order for a file to never be deleted from a web, you have to create it using specific file naming conventions. It's pretty simple. Hemingway will NOT DELETE any file with a _x as the last two letters before the extension. So, myfile.pdf will be deleted but myfile_x.pdf will not be deleted. There is a shortcut for doing this in the File Manager Plugin - just click the Never Delete button and it will automatically name the file for you.
File Manager Operation
Choose Folder button
The Choose Folder button will prompt you for a folder from which to either upload or download files. The folder you select will be displayed at the bottom left of the File Manager window. The contents of the folder will be displayed in the Local Files Window.
Choose Web
The Choose Web button will prompt you for a web to choose to display the contents of.
Refresh
Refreshes the Web Contents List
Delete File
Deletes the file highlighted in the Web Contents List. This command also deletes the file from the Staging folder.
Download File Button
Downloads to the designated local folder the file highlighted in the Web Contents List.
Upload File Button
Uploads to the Web Contents List the file designated in the Local Files list. This also uploads the file to the Staging folder
Restricted Access Button
If checked, your web is set to 'Restricted Access Mode' and you will not be able to upload or download any files. Uncheck it, download and upload files, and then don't forget to check it before closing the window. While unchecked, files may be accessed from the Internet, so be quick!
Close Window
Closes the File Manager Plugin