get_ext <- function(file){
# remove a path
splitted <- strsplit(x=fn, split=.Platform$file.sep)[[1]]
# or use .Platform$file.sep in stead of '/'
fn <- splitted [length(splitted)]
ext <- ''
splitted <- strsplit(x=fn, split='\\.')[[1]]
l <-length (splitted)
if (l > 1 && sum(splitted[1:(l-1)] != '')) ext <-splitted [l]
# the extention must be the suffix of a non-empty name
ext
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.