WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center
Wolfram Language Home Page »

"CachedFile" (Interpreter Type)

A file to be copied in a local directory.

Details

  • "CachedFile" can be used in Interpreter and related constructs, including deployed smart form fields.
  • Use of "CachedFile" does not require connectivity to the Wolfram Cloud.
  • Unlike most interpretation types, "CachedFile" has a side effect: it creates a new file on disk.
  • "CachedFile" 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 ["CachedFile" ,format] a file of a given format
    Restricted ["CachedFile" ,format,max] a file of a given format and size smaller than max bytes
    Restricted ["CachedFile" ,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

  • "CachedFile" yields File ["newpath"], where "newpath" is where the file has been copied to.

Examples

Basic Examples  (1)

Cache files:

Restrict to a file format:

Restrict to all image files:

Restrict to a given size:

"CachedFile" also works with a CloudObject :

"CachedFile" also works with a URL object:

See Also

Interpreter   Restricted   Failure   CloudObject   File   URL

Interpreter Types: UploadedFile   FileName   ImportFormatString   ExportFormatString   MIMETypeString

History

Introduced in 2014 (10.0)

Top [フレーム]

AltStyle によって変換されたページ (->オリジナル) /