Get the URL for a file uploaded by a worker as part of a HIT, or download the file(s) directly to the working directory.
GetFileUpload(assignment, questionIdentifier, download = FALSE, file.ext = NULL,
open.file.in.browser = FALSE, verbose = getOption('MTurkR.verbose'), ...)
A character string containing an AssignmentId, or a vector of character strings each containing an AssignmentId.
A question identifer for a file upload question, as specified in the question
parameter of CreateHIT
or in the placeholder of a HIT template created in the RUI.
A logical specifying whether the file(s) should be downloaded and saved in the working directory. Default is FALSE
.
An optional character string specifying the file extension of the uploaded files (used only if download=TRUE
).
A logical specifying whether the file should be opened in the user's default web browser.
Optionally print the results of the API request to the standard output. Default is taken from getOption('MturkR.verbose')
.
Additional arguments passed to request
.
Depending on the specification, either a character string containing a temporary URL (which lasts 60 seconds) where the uploaded file can be downloaded, or the files themselves are opened in the user's default web browser, or directly downloaded and saved to the working directory.
Note that a FileUploadURL is only valid for 60 seconds (per MTurk documentation), so URLs should either be retrieved one at a time or files should be automatically downloaded to the working directory with the download=TRUE
. If browser=TRUE
, request is executed in the user's default web browser, whereas if open.file.in.browser=TRUE
, the request is executed in R and the file itself is opened in the browser.
geturls()
is an alias.
# NOT RUN {
GetFileUpload("26XXH0JPPSI23H54YVG7BKLO82DHNU","dictation",download=TRUE)
# }
Run the code above in your browser using DataLab