Skip to content

Instantly share code, notes, and snippets.

@DarrynNyberg
DarrynNyberg / my_module.module
Created June 15, 2017 16:29
Custom Drupal Module Update From File Content
function nytech_logs_node_presave() {
// check to see if it is the node type you need.
if($node->type == '<your-node-type-here>') {
// check to see if there is an attached file
if(!empty($node->field_log_file)) {
// get the 'uri' of the file
$uri = $node->field_log_file['und'][0]['uri'];
// get the full file path
$filepath = drupal_realpath($uri);
// load the file into a string
@DarrynNyberg
DarrynNyberg / kebase.md
Created August 27, 2014 20:31
KeyBase Auth

Keybase proof

I hereby claim:

  • I am darrynnyberg on github.
  • I am darrynnyberg (https://keybase.io/darrynnyberg) on keybase.
  • I have a public key whose fingerprint is 3246 D668 9524 8CC3 8D4F 2840 B591 B0AF 3B34 FB45

To claim this, I am signing this object: