input$inputId
(providing input
is
the name of the input object in the shinyServer()
call). The file
names should be parsed with parseFilePaths
before usage though,
to make them compliant with the fileInput
function.shinyFilesButton(inputId, label, title, multiple)
parseFilePaths
for a more beautiful output.For users wanting to design their html markup manually it is very easy to add a shinyFiles button. The only markup required is:
where the id tag matches the inputId parameter, the data-title tag matches the title parameter, the data-selecttype is either "single" or "multiple" ( the non-logical form of the multiple parameter) and the internal textnode mathces the label parameter.
Apart from this the html document should link to a script with the following path 'sF/shinyFiles.js' and a stylesheet with the following path 'sF/styles.css'.
The markup is bootstrap compliant so if the bootstrap css is used in the page the look will fit right in. There is nothing that hinders the developer from ignoring bootstrap altogether and designing the visuals themselves. The only caveat being that the glyphs used in the menu buttons are bundled with bootstrap. Use the css ::after pseudoclasses to add alternative content to these buttons. Additional filetype specific icons can be added with css using the following style:
.sF-file .sF-file-icon .yourFileExtension{ content: url(path/to/16x16/pixel/png); } .sF-fileList.sF-icons .sF-file .sF-file-icon .yourFileExtension{ content: url(path/to/32x32/pixel/png); }
If no large version is specified the small version gets upscaled.
parseFilePaths
;
shinyFileChoose
;
shinyFilesExample