s <- Rhttpd$new()
if (FALSE) {
s$start(quiet=TRUE)
}
s$add(name="multi",
app=function(env){
req <- Request$new(env)
res <- Response$new()
res$write('')
res$write('Upload a file: ')
res$write('')
post <- Multipart$parse(env)
if (length(post)){
poststr <- paste(capture.output(str(post),file=NULL),collapse='\n')
res$write(c('',poststr,''))
}
res$finish()
}
)
if (FALSE) {
s$browse('multi') # Opens a browser window to the app.
}
s$remove(all=TRUE)
rm(s)
Run the code above in your browser using DataLab