Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jayanthdeejay/cdd77f6b3156d3cff3d216ce9ca79d46 to your computer and use it in GitHub Desktop.
Save jayanthdeejay/cdd77f6b3156d3cff3d216ce9ca79d46 to your computer and use it in GitHub Desktop.
Changing the content of a file
gf = GenericFile.find("abc123")
file = File.open("file name")
content = file.read
gf.content.content = content
gf.create_derivatives
gf.visibility = "open"
gf.save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment