Obtain extension of input filename in R shiny server

shiny

#1

Is there any other function or package to obtain extensions in filenames?
I tried using file_ext() function from R package library(R.utils), it works on Rtsudio server but fails to work on shiny server.


#2

If all else fails, there is always regex:

gsub("(.+)\\.(.+?$)","\\2", "file.info")
># info
gsub("(.+)\\.(.+?$)","\\2", "htmls.peeples")
># peeples

Combine with basename() to clean up file paths.


#3

file_ext() is in the tools package, which isn't automatically loaded.