# How to apply RenameFile to a CloudObject

As the documemtation in Details and Options:

RenameFile works on cloud objects, changing their cloud file names but not their UUIDs.

I think this sentense imply the RenameFile can apply into CloudObject,but the question is how to?There are some examples of failure:

g=CloudDeploy[FormFunction[{"x"->"Integer"},#x!&]]
(* CloudObject[https://www.wolframcloud.com/objects/a13f1c37-68e7-4d5b-a4d1-549ba0311230] *)

ToString[First[g]]
(* https://www.wolframcloud.com/objects/a13f1c37-68e7-4d5b-a4d1-549ba0311230 *)

RenameFile[ToString[First[g]],"https://www.wolframcloud.com/objects/testgname"]
(* $Failed *) RenameFile[g,CloudObject["https://www.wolframcloud.com/objects/testgname"]] (*$Failed *)

• What do you expect to happen if each of us change one of our urls to https://www.wolframcloud.com/objects/testgname?
– Kuba
Oct 6, 2016 at 10:59
• @Kuba Yes,can we?
– yode
Oct 6, 2016 at 11:09

You can't specify the url fully, it has to contain information that it is yours. So \$WolframUUID needs to be there, you can change the name:

co = CloudDeploy[FormFunction[{"x" -> "Integer"}, #x! &], "name"]

CloudObject[https://www.wolframcloud.com/objects/user-..../name]

RenameFile[co, CloudObject["anotherName"]]

CloudObject[https://www.wolframcloud.com/objects/user-..../anotherName]


Alternatively you can use URLShorten to make it more compact.

• Wow,it is exactly what I want.Thanks a lot.And I note the anonymous CloudObject is not in my cloud directory and we cannot find it in this page?
– yode
Oct 6, 2016 at 18:33