Description Usage Arguments Details Value
Copy a single file from one location to another
1 2 | copy_file(from_file = NULL, to_dir = ".", json_data = NULL,
tmp_loc = "/tmp", clean_file_fun = clean_filename)
|
from_file |
the location of the original file |
to_dir |
the location to copy the file to |
json_data |
the json meta information data |
tmp_loc |
temp location if you want to specify it |
clean_file_fun |
function used to rename the file |
We want to keep track of information about the copied files, so this function does some stuff to help us out. It strips special characters from the base file name, copies the file to a temp location, calculates the SHA-1 hash of the file, checks the JSON meta file for matches to the SHA-1, and if there are none, copies the renamed file to the copy location.
If a matching instance of SHA-1 hashes are found, then the file path is added to the entry for that file location.
If a matching file name is found but with a different SHA-1 hash, then the first 8 characters of the SHA-1 hash are appended to the file, and it is added to the database.
list
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.