gfile: File selection form

Description Usage Arguments Details Value Note Examples

Description

This renders a file selection form within a small panel widget. There are two steps needed to transfer a file: a) select a file through a dialog, b) save the file to the server by clicking the upload button.

Usage

1
2
3
4
5
6
  gfile(text = "Choose a file", type = c("open"),
    filter = NULL, handler = NULL, action = NULL,
    container = NULL, ..., width = NULL, height = NULL,
    ext.args = NULL, fieldlabel = NULL,
    placeholder = gettext("Select a file..."),
    upload.message = gettext("Uploading your file ..."))

Arguments

text

Instructional text.

type

only "open" implemented

filter

ignored

handler

optional handler bound via addHandlerChanged

action

optional value to paramaterize handler

container

parent container

...

passed along to add call of the container. Can be used to adjust layout parameters. May also have other uses.

width

a pre-specified width (in pixels) for the widget

height

a pre-specified height (in pixels) for the widget

ext.args

A list of extra arguments to pass to the ExtJS constructor

Details

When a file is uploaded, any change handlers are called.

The svalue method gives the path of the uploaded file, the [ method gives the original name of the file when uploaded.

Value

a GFile instance

Note

the svalue method returns the temporary filename of the uploaded file, or a value of "". The [ method gives the original filename, once one is uploaded.

Examples

1
2
3
4
5
w <- gwindow()
gstatusbar("Powered by gWidgetsWWW2 and Rook", cont=w)
f <- gfile("Choose a file for upload", cont=w, handler=function(h,...) {
  galert(paste("You uploaded", svalue(h$obj)), parent=w)
})

jverzani/gWidgetsWWW2.rapache documentation built on May 20, 2019, 5:19 a.m.