title: R Shiny warning message when wrong file is uploaded
body: <p>I want to have a feature in my shiny app that when someone uploads a file which is not in .csv format they recieve a warning and when they do upload in .csv format it prints the table. here is my UI code</p>
  
  <pre><code>shinyUI(
  tabPanel("File Upload",
                        h4("File Upload"),
                        sidebarLayout(
                          sidebarPanel(
                            fileInput('file1', 'Choose CSV file to upload',
                                      accept = c(
                                        'text/csv',
                                        'text/comma-separated-values',
                                        'text/tab-separated-values',
                                        'text/plain',
                                        '.csv',
                                        '.tsv'
                                      )
                            )
                          ),
                          mainPanel(
                            tableOutput('upload'),
                            h1(textOutput("warning1"))
                            )
  
  
                        )
  
                 )
  )
  </code></pre>
  
  <p>and my Server code</p>
  
  <pre><code>shinyServer(function(input, output) {
  
  output$upload &lt;- renderTable({
  
  
    #assign uploaded file to a variable
    File &lt;- input$file1
  
    #catches null exception
    if (is.null(File))
      return(NULL)
  
    read.csv(File$datapath)
  
  })
  
  output$warning1 &lt;- renderPrint({
  
    upload&lt;- input$file1
    if (is.null(upload))
      return(NULL)
  
    if (upload$type != c(
                            'text/csv',
                            'text/comma-separated-values',
                            'text/tab-separated-values',
                            'text/plain',
                            '.csv',
                            '.tsv'
                          )    
        )
    return ("Wrong File Format try again!")
  
  
  })
  
  
  }
  </code></pre>