I've got some stuff that I want to be able distribute to my totally real friends, but I don't want to have to email them every time I change something.

How can I set up sharing via the cloud?


1 Answer 1



When you put stuff in the cloud it's good to use your short URL in the URI (or copy it in after to shrink down the link length and scariness):

CloudPut[1, "user:b3m2a1/whee"]


The cloud happily makes this really easy. Say we just want to distribute some expression to someone. All we need is the following:

In[307]:= CloudExport[
 Permissions -> "Public"

Out[307]= \

And then our friend can go to that link and the thing will download for them to work with. Or, better yet, they can import it directly into Mathematica:

In[308]:= CloudImport@CloudObject[

Out[308]= ByteArray[< 10 >]

For that they, too, will need a free cloud account, but if they don't want to do that all is not lost. The resource is still semi-accessible via Import:

In[312]:= Import[CloudObject[

Out[312]= "(* Created with the Wolfram Language : www.wolfram.com *)

And a quick little ToExpression will extract what we need.

Note that this won't alway work absolutely as formatting can get wonky.

Furthermore, if we use a fixed URL:

In[319]:= CloudExport[
 Permissions -> "Public"

Out[319]= \

our friend need only know one URL and the updating version will always be available


Where this really gets cool, though, is how you can distribute packages.

The CloudGet function acts just like Get but for the cloud, and so if you have a package file and you copy it to the cloud via CopyFile, your friend can run CloudGet on that and all of your code will become immediately accessible to them.


But wait! There's more!

We can set up a paclet site in the cloud so that our entire application can be easily distributed. And we can combine this with CloudGet to configure an auto-installer for our package. Run this:


and (assuming I haven't broken anything since I last tested it) you'll get the current version of a package of little tools I wrote. Note that I used URLShorten on the longer URL that that hides.

You can then uninstall this via:


Standard HTML Content

Note, too, that the cloud can take standard HTML/CSS content, too.

I have code that will turn a PacletSite.mz into an HTML page that can be deployed.

Update: full static websites

So going above and beyond what I'd done before with the cloud I recently wrote a system to push a full static website up there: https://www.wolframcloud.com/objects/b3m2a1/home/building-websites-with-mathematica.html#main-content

The www.wolframcloud.com/objects is ugly, yes, but it's so convenient to just be able to push things from within Mathematica (as I write my posts and pages in Mathematica anyway).

  • $\begingroup$ @yode glad to help. Perhaps this will free you from having to distribute code as byte images through imgur (although I do enjoy the cleverness of that approach). $\endgroup$
    – b3m2a1
    Commented Apr 21, 2017 at 7:05
  • 2
    $\begingroup$ @MB1965 What is the purpose of BinarySerialize in your example? $\endgroup$
    – Ray Shadow
    Commented Apr 21, 2017 at 8:57
  • $\begingroup$ @Shadowray it's just an arbitrary expression to distribute. This came out of a discussion with yode where we were working with it. $\endgroup$
    – b3m2a1
    Commented Apr 21, 2017 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.