---
title: "CloudPut"
language: "en"
type: "Symbol"
summary: "CloudPut[expr] writes expr to a new anonymous cloud object. CloudPut[expr,  uri] writes expr to a cloud object at a given URI. CloudPut[expr, CloudObject[uri]] writes expr to a given cloud object."
keywords: 
- output to cloud
- store in cloud
- put in cloud
- save in cloud
- cloud upload
- place in cloud
- remote storage
canonical_url: "https://reference.wolfram.com/language/ref/CloudPut.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Cloud Functions & Deployment"
    link: "https://reference.wolfram.com/language/guide/CloudFunctionsAndDeployment.en.md"
related_workflows: 
  - 
    title: "Store Data in a Cloud Object"
    link: "https://reference.wolfram.com/language/workflow/StoreDataInACloudObject.en.md"
related_functions: 
  - 
    title: "CloudGet"
    link: "https://reference.wolfram.com/language/ref/CloudGet.en.md"
  - 
    title: "CloudSave"
    link: "https://reference.wolfram.com/language/ref/CloudSave.en.md"
  - 
    title: "CloudExport"
    link: "https://reference.wolfram.com/language/ref/CloudExport.en.md"
  - 
    title: "CloudDeploy"
    link: "https://reference.wolfram.com/language/ref/CloudDeploy.en.md"
  - 
    title: "CopyFile"
    link: "https://reference.wolfram.com/language/ref/CopyFile.en.md"
  - 
    title: "Put"
    link: "https://reference.wolfram.com/language/ref/Put.en.md"
  - 
    title: "Get"
    link: "https://reference.wolfram.com/language/ref/Get.en.md"
  - 
    title: "DatabinAdd"
    link: "https://reference.wolfram.com/language/ref/DatabinAdd.en.md"
  - 
    title: "BlockchainPut"
    link: "https://reference.wolfram.com/language/ref/BlockchainPut.en.md"
---
# CloudPut

CloudPut[expr] writes expr to a new anonymous cloud object.

CloudPut[expr, "uri"] writes expr to a cloud object at a given URI.

CloudPut[expr, CloudObject["uri"]] writes expr to a given cloud object.

## Details and Options

* ``CloudPut`` returns the resulting ``CloudObject``.

* ``CloudPut[expr, URL["uri"]]`` is also supported.

* To copy an existing local file to the cloud, use ``CopyFile``.

* ``CloudPut`` allows the following options:

|                        |                         |                                                                       |
| ---------------------- | ----------------------- | --------------------------------------------------------------------- |
| CachePersistence       | Automatic               | controls the time duration for which an object  is cached by a client |
| CloudBase              | Automatic               | what cloud to write to                                                |
| CloudObjectNameFormat  | \$CloudObjectNameFormat | format to use for the name portion of the URL                         |
| CloudObjectURLType     | \$CloudObjectURLType    | base type of URL to use (obj, env, ...)                               |
| IconRules              | Automatic               | icons to use for the object                                           |
| IncludeDefinitions     | False                   | whether to automatically include dependencies                         |
| MetaInformation        | {}                      | metainformation for the object                                        |
| Permissions            | Automatic               | permissions for the object                                            |

* With ``IncludeDefinitions -> False``, ``CloudPut[expr, …]`` includes only ``expr`` itself in the cloud object it creates.

* With ``IncludeDefinitions -> True``, ``CloudPut[expr, …]`` automatically includes all definitions needed to evaluate ``expr`` in the cloud object it creates.

---

## Examples (12)

### Basic Examples (2)

Save a computed value in an unnamed cloud object:

```wl
In[1]:= CloudPut[47!]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/da3b95a9-95de-4823-9c57-fedccc0e85f2"]
```

Retrieve the value:

```wl
In[2]:= CloudGet[%]

Out[2]= 258623241511168180642964355153611979969197632389120000000000
```

---

Save a named cloud object:

```wl
In[1]:= CloudPut[47!, "myfile"]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/documentation/myfile"]

In[2]:= CloudGet["myfile"]

Out[2]= 258623241511168180642964355153611979969197632389120000000000
```

### Scope (2)

Save a named cloud object specified by a string:

```wl
In[1]:= CloudPut[47!, "myfile"]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/documentation/myfile"]
```

Save a named cloud object specified by a ``CloudObject`` :

```wl
In[2]:= CloudPut[47!, CloudObject["myfile"]]

Out[2]= CloudObject["https://www.wolframcloud.com/obj/documentation/myfile"]

In[3]:= CloudGet["myfile"]

Out[3]= 258623241511168180642964355153611979969197632389120000000000
```

Save a named cloud object specified by a URL:

```wl
In[4]:= CloudPut[47!, URL["https://www.wolframcloud.com/obj/documentation/myfile"]]

Out[4]= CloudObject["https://www.wolframcloud.com/obj/documentation/myfile"]

In[5]:= CloudGet["myfile"]

Out[5]= 258623241511168180642964355153611979969197632389120000000000
```

---

Save an unevaluated expression:

```wl
In[1]:= obj = CloudPut[Unevaluated[DateObject[]]]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/9365edb7-868a-4d52-95df-ff0b07f2cbb1"]
```

The expression has been stored in unevaluated form:

```wl
In[2]:= FilePrint[obj]

DateObject[]
```

The expression evaluates each time it is read:

```wl
In[3]:=
t0 = Now;
Table[Get[obj] - t0, {3}]

Out[3]= {Quantity[0.1840184, "Seconds"], Quantity[0.2880288, "Seconds"], Quantity[0.3560356, "Seconds"]}
```

### Options (6)

#### CloudBase (1)

Write an expression to a different cloud:

```wl
In[1]:= CloudPut[WeatherData[$GeoLocation, "Temperature", "NonMetricValue"], "temp", CloudBase -> "https://www.epc.example.com"]

Out[1]= CloudObject["https://www.epc.example.com/obj/documentation/temperature"]
```

#### CloudObjectNameFormat (1)

Write to a cloud object and return the URL in the user UUID format:

```wl
In[1]:= CloudPut[{$GeoLocationCity, $GeoLocationCountry}, "current-location", CloudObjectNameFormat -> "CloudUserUUID"]

Out[1]=
CloudObject[
 "https://www.wolframcloud.com/obj/user-b0c28e9f-876d-4478-9d8b-9e7d18a9ea81/current-location"]
```

#### CloudObjectURLType (1)

Write to a cloud object and return the URL in the form for opening within the cloud environment:

```wl
In[1]:= CloudPut[{$GeoLocationCity, $GeoLocationCountry}, "current-location", CloudObjectURLType -> "Environment"]

Out[1]= CloudObject["https://www.wolframcloud.com/env/documentation/current-location"]
```

#### IncludeDefinitions (1)

Write an unevaluated expression that depends on other symbol definitions, and include those definitions:

```wl
In[1]:=
f[n_] := Boole[Negative[n]] * (n + 1);
obj = CloudPut[Unevaluated[f[Now["Hour"]]], IncludeDefinitions -> True]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/b4cfdfb3-15de-4be7-9d3d-b85cf08c0101"]
```

The object has been stored unevaluated with the definition for ``f`` :

```wl
In[2]:= FilePrint[obj]

Language`ExtendedFullDefinition[] = Language`DefinitionList[HoldForm[Global`f] -> {OwnValues -> {}, SubValues -> {}, UpValues -> {}, DownValues -> {HoldPattern[Global`f[Global`n_]] :> Boole[Negative[Global`n]]*(Global`n + 1)}, NValues -> {}, FormatValues -> {}, DefaultValues -> {}, Messages -> {}, Attributes -> {}}];

Global`f[Now["Hour"]]
```

#### MetaInformation (1)

Write to a cloud object and include some metainformation:

```wl
In[1]:= CloudPut[{$GeoLocationCity, $GeoLocationCountry}, "current-location", MetaInformation -> <|"Source" -> SystemInformation["Kernel", "ProductIDName"], "OperatingSystem" -> $OperatingSystem|>]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/documentation/current-location"]
```

The metainformation can be read back later:

```wl
In[2]:= Options[CloudObject["current-location"], MetaInformation]

Out[2]= {MetaInformation -> {"OperatingSystem" -> "Windows", "Source" -> "Mathematica"}}
```

#### Permissions (1)

Write to a cloud object that will require another user to be logged in to access it:

```wl
In[1]:= CloudPut[{$GeoLocationCity, $GeoLocationCountry}, Permissions -> "Authenticated" -> "Read"]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/e8f66a75-a30a-45f0-9680-e8b70d68baa4"]
```

### Properties & Relations (1)

``Put`` with a ``CloudObject`` destination is equivalent to ``CloudPut`` :

```wl
In[1]:= Put[42, CloudObject[]]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/a008b9f3-29d4-4689-8e30-a799b440c762"]
```

Use ``PutAppend`` with a cloud object to append an expression to a cloud object instead of completely replacing its contents as ``CloudPut`` does:

```wl
In[2]:=
obj = PutAppend[1, CloudObject[]];
ReadList[obj]

Out[2]= {1}
```

Append another expression and read all the expressions in the object:

```wl
In[3]:=
PutAppend[2, obj];
ReadList[obj]

Out[3]= {1, 2}
```

### Possible Issues (1)

Using ``CloudPut`` for expressions like ``APIFunction`` that have special behavior in the cloud does not activate their special behavior:

```wl
In[1]:= api = CloudPut[APIFunction[{"P" -> Number, "r" -> Number, "t" -> Number}, #P(1 + #r * #t)&]]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/0a8b7d15-3e3c-44f1-aa1b-2d0dc2341597"]
```

Calling the cloud object does not do any computation since an expression is simply displayed using HTML, which happens to be imported as something readable by ``URLExecute`` :

```wl
In[2]:= URLExecute[api, {"P" -> 1000, "r" -> 2.3, "t" -> 72}]

Out[2]= "APIFunction[{\"P\" -> Number, \"r\" -> Number, \"t\" -> Number}, #P*(1 + #r*#t) & ]"
```

In order to create a usable ``APIFunction``, it must be deployed with ``CloudDeploy`` or ``CloudPublish`` :

```wl
In[3]:= api = CloudDeploy[APIFunction[{"P" -> Number, "r" -> Number, "t" -> Number}, #P(1 + #r * #t)&]]

Out[3]= CloudObject["https://www.wolframcloud.com/obj/100e85cd-9c84-4085-847a-888aaa10b7aa"]
```

Now it reads the parameters and evaluates the function when invoked, as intended:

```wl
In[4]:= URLExecute[api, {"P" -> 1000, "r" -> 2.3, "t" -> 72}]

Out[4]= "166600."
```

## See Also

* [`CloudGet`](https://reference.wolfram.com/language/ref/CloudGet.en.md)
* [`CloudSave`](https://reference.wolfram.com/language/ref/CloudSave.en.md)
* [`CloudExport`](https://reference.wolfram.com/language/ref/CloudExport.en.md)
* [`CloudDeploy`](https://reference.wolfram.com/language/ref/CloudDeploy.en.md)
* [`CopyFile`](https://reference.wolfram.com/language/ref/CopyFile.en.md)
* [`Put`](https://reference.wolfram.com/language/ref/Put.en.md)
* [`Get`](https://reference.wolfram.com/language/ref/Get.en.md)
* [`DatabinAdd`](https://reference.wolfram.com/language/ref/DatabinAdd.en.md)
* [`BlockchainPut`](https://reference.wolfram.com/language/ref/BlockchainPut.en.md)

## Related Guides

* [Cloud Functions & Deployment](https://reference.wolfram.com/language/guide/CloudFunctionsAndDeployment.en.md)

## Related Workflows

* [Store Data in a Cloud Object](https://reference.wolfram.com/language/workflow/StoreDataInACloudObject.en.md)

## Related Links

* [Fast Introduction for Programmers: Cloud Deployment](http://www.wolfram.com/language/fast-introduction-for-programmers/cloud-deployment/)
* [An Elementary Introduction to the Wolfram Language: Storing Things](https://www.wolfram.com/language/elementary-introduction/43-storing-things.html)

## History

* [Introduced in 2014 (10.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn100.en.md) \| [Updated in 2016 (11.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn110.en.md) ▪ [2019 (12.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn120.en.md)