EVOLUTION-MANAGER
Edit File: fileInput.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: File Upload Control</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for fileInput {shiny}"><tr><td>fileInput {shiny}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>File Upload Control</h2> <h3>Description</h3> <p>Create a file upload control that can be used to upload one or more files. </p> <h3>Usage</h3> <pre> fileInput( inputId, label, multiple = FALSE, accept = NULL, width = NULL, buttonLabel = "Browse...", placeholder = "No file selected" ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>inputId</code></td> <td> <p>The <code>input</code> slot that will be used to access the value.</p> </td></tr> <tr valign="top"><td><code>label</code></td> <td> <p>Display label for the control, or <code>NULL</code> for no label.</p> </td></tr> <tr valign="top"><td><code>multiple</code></td> <td> <p>Whether the user should be allowed to select and upload multiple files at once. <strong>Does not work on older browsers, including Internet Explorer 9 and earlier.</strong></p> </td></tr> <tr valign="top"><td><code>accept</code></td> <td> <p>A character vector of "unique file type specifiers" which gives the browser a hint as to the type of file the server expects. Many browsers use this prevent the user from selecting an invalid file. </p> <p>A unique file type specifier can be: </p> <ul> <li><p> A case insensitive extension like <code>.csv</code> or <code>.rds</code>. </p> </li> <li><p> A valid MIME type, like <code>text/plain</code> or <code>application/pdf</code> </p> </li> <li><p> One of <code style="white-space: pre;">audio/*</code>, <code style="white-space: pre;">video/*</code>, or <code style="white-space: pre;">image/*</code> meaning any audio, video, or image type, respectively. </p> </li></ul> </td></tr> <tr valign="top"><td><code>width</code></td> <td> <p>The width of the input, e.g. <code>'400px'</code>, or <code>'100%'</code>; see <code><a href="reexports.html">validateCssUnit()</a></code>.</p> </td></tr> <tr valign="top"><td><code>buttonLabel</code></td> <td> <p>The label used on the button. Can be text or an HTML tag object.</p> </td></tr> <tr valign="top"><td><code>placeholder</code></td> <td> <p>The text to show before a file has been uploaded.</p> </td></tr> </table> <h3>Details</h3> <p>Whenever a file upload completes, the corresponding input variable is set to a dataframe. See the <code style="white-space: pre;">Server value</code> section. </p> <h3>Server value</h3> <p>A <code>data.frame</code> that contains one row for each selected file, and following columns: </p> <dl> <dt><code>name</code></dt><dd><p>The filename provided by the web browser. This is <strong>not</strong> the path to read to get at the actual data that was uploaded (see <code>datapath</code> column).</p> </dd> <dt><code>size</code></dt><dd><p>The size of the uploaded data, in bytes.</p> </dd> <dt><code>type</code></dt><dd><p>The MIME type reported by the browser (for example, <code>text/plain</code>), or empty string if the browser didn't know.</p> </dd> <dt><code>datapath</code></dt><dd><p>The path to a temp file that contains the data that was uploaded. This file may be deleted if the user performs another upload operation.</p> </dd> </dl> <h3>See Also</h3> <p>Other input elements: <code><a href="actionButton.html">actionButton</a>()</code>, <code><a href="checkboxGroupInput.html">checkboxGroupInput</a>()</code>, <code><a href="checkboxInput.html">checkboxInput</a>()</code>, <code><a href="dateInput.html">dateInput</a>()</code>, <code><a href="dateRangeInput.html">dateRangeInput</a>()</code>, <code><a href="numericInput.html">numericInput</a>()</code>, <code><a href="passwordInput.html">passwordInput</a>()</code>, <code><a href="radioButtons.html">radioButtons</a>()</code>, <code><a href="selectInput.html">selectInput</a>()</code>, <code><a href="sliderInput.html">sliderInput</a>()</code>, <code><a href="submitButton.html">submitButton</a>()</code>, <code><a href="textAreaInput.html">textAreaInput</a>()</code>, <code><a href="textInput.html">textInput</a>()</code>, <code><a href="varSelectInput.html">varSelectInput</a>()</code> </p> <h3>Examples</h3> <pre> ## Only run examples in interactive R sessions if (interactive()) { ui <- fluidPage( sidebarLayout( sidebarPanel( fileInput("file1", "Choose CSV File", accept = ".csv"), checkboxInput("header", "Header", TRUE) ), mainPanel( tableOutput("contents") ) ) ) server <- function(input, output) { output$contents <- renderTable({ file <- input$file1 ext <- tools::file_ext(file$datapath) req(file) validate(need(ext == "csv", "Please upload a csv file")) read.csv(file$datapath, header = input$header) }) } shinyApp(ui, server) } </pre> <hr /><div style="text-align: center;">[Package <em>shiny</em> version 1.5.0 <a href="00Index.html">Index</a>]</div> </body></html>