title: R Shiny: write image from r shiny input to sql then render
body: <p>ui</p>
  <p><img src="https://i.stack.imgur.com/99qC3.png" alt="enter image description here" /></p>
  <pre class="lang-r prettyprint-override"><code>tabItem(tabName=&quot;imageinput&quot;,
                            box(status = &quot;info&quot;,solidHeader = TRUE,collapsible = TRUE,
                                width = 12,                     textInput(&quot;ContactName&quot;,label=NULL,placeholder=&quot;Enter Contact Name&quot;),
                                `enter code here`textInput(&quot;ContactEmail&quot;,label=NULL,placeholder=&quot;Enter Contact Email&quot;),
                                textAreaInput(&quot;Comments&quot;, label = &quot;Describe Activity:&quot;,placeholder = NULL)
                        ,
                            fileInput(&quot;upload&quot;, NULL, buttonLabel = &quot;Upload...&quot;, multiple = FALSE),
                        actionButton(&quot;GoPost&quot;, &quot;Submit Suspicious Activity&quot;, style = &quot;font-family: 'Palatino', Arial Black;&quot;),
                        column(width=12,
                               fluidRow(box(column(width=12,(DT::dataTableOutput(&quot;tableForum&quot;)))
                               ))
                        ),
                            renderImage(&quot;img2&quot;,deleteFile = FALSE)))
  </code></pre>
  <p>this is what i have to insert name, email comments and photoupload
  the below will take the image but every time i try to insert into the query to paste to the db, it says there is sql query error.. can someone please help</p>
  <p>Warning: Error in new_result: Expecting a single string value: [type=character; extent=4].
  [No stack trace available]</p>
  <pre class="lang-r prettyprint-override"><code>   qryForum = paste0(&quot;INSERT INTO imagetable (ContactName,ContactEmail,Comments,photoupload)&quot;,
                        &quot;VALUES ('&quot;,paste(input$ContactName,&quot;'&quot;,&quot;,&quot;,&quot;'&quot;,input$ContactEmail,&quot;'&quot;,&quot;,&quot;,&quot;'&quot;,input$Comments,&quot;'&quot;,&quot;,&quot;,&quot;'&quot;,input$upload&quot;')&quot;))
      ###Query to send to database
      dbSendQuery(my.db,qryForum)
      querygetForum &lt;- paste(&quot;select * from imagetable;&quot;)
      dataForum &lt;- dbGetQuery(my.db, querygetForum)`
  </code></pre>