"UploadedFile" (Interpreter Type)
A file to be copied to a cloud object.
Details
- "UploadedFile" can be used in Interpreter and related constructs, including deployed smart form fields.
- Use of "UploadedFile" requires connectivity to the Wolfram Cloud.
- Unlike most interpretation types, "UploadedFile" has a side effect: it creates a CloudObject for the given file.
- "UploadedFile" treats File["file"] and URL["url"] as "file" and "url", respectively.
Allowed Forms
-
File["path"] a path to a local file URL["url"] a URL CloudObject["url"] a cloud object
Restriction Specifications
-
Restricted["UploadedFile",format] a file of a given format Restricted["UploadedFile",format,max] a file of a given format and size smaller than max bytes Restricted["UploadedFile",format,{min,max}] a file of a given format and size between min and max bytes - The bounds min and max can also be expressed as quantities in the appropriate unit (e.g. Quantity[1,"Megabytes"]).
Interpretation
- "UploadedFile" creates a CloudObject for the given file.
Examples
Basic Examples (3)
file = File["ExampleData/ocelot.jpg"]Interpreter["UploadedFile"][file]Interpreter[Restricted["UploadedFile", "JPEG"]][file]Interpreter[Restricted["UploadedFile", "Image"]][file]Interpreter[Restricted["UploadedFile", Automatic, 300]][file]"UploadedFile" also works with a CloudObject:
object = CloudExport[Plot[Sin[x],{x,0,10}],"GIF","plot.gif"]Interpreter["UploadedFile"][object]"UploadedFile" also accepts a URL:
Interpreter["UploadedFile"][URL["https://www.wolframcloud.com/obj/user-b0c28e9f-876d-4478-9d8b-9e7d18a9ea81/plot.gif"]]See Also
Interpreter Restricted Failure CloudObject File URL
Interpreter Types: CachedFile FileName ImportFormatString ExportFormatString MIMETypeString
Related Guides
History
Introduced in 2014 (10.0)