File: read.r

package info (click to toggle)
rapache 1.2.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,248 kB
  • sloc: sh: 18,629; ansic: 10,417; perl: 5,675; javascript: 2,800; makefile: 307
file content (17 lines) | stat: -rw-r--r-- 608 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
if (is.null(FILES)) rnorm(10)
tmpfile <- NULL
if(!is.null(SERVER) && ("method" %in% names(SERVER)) && (SERVER$method == "POST") ){
	tmpfile <- tempfile()
	con <- file(tmpfile,open="w")
	writeLines(readLines(),con);
	close(con);
}
setContentType("text/html")
cat("</html><body>")
cat('<H1>Using R To Read Input</H1>\n')
if (!is.null(tmpfile)) cat('<H3>We read to this file:',tmpfile,'</H3>\n')
cat('<form enctype="multipart/form-data" method=POST action="/test/read.r">\n')
cat('Upload a file: <input type=file name="fileUpload"><br>\n')
cat('<input type=submit name=Submit>')
cat("</form></body></html>")
-2