<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
}
/**
- * Create an attachment.
+ * Create an Attachment.
*
* @param array $params
*
* @return array
- * Array of newly created file property values.
* @throws API_Exception validation errors
* @see Civi\API\Subscriber\DynamicFKAuthorization
*/
file_put_contents($path, $content);
}
elseif (is_string($moveFile)) {
- rename($moveFile, $path);
+ // CRM-17432 Do not use rename() since it will break file permissions.
+ // Also avoid move_uplaoded_file() because the API can use options.move-file.
+ copy($moveFile, $path);
+ unlink($moveFile);
}
// Save custom field to entity
}
/**
- * Get attachment.
+ * Get Attachment.
*
* @param array $params
*
}
/**
- * Adjust metadata for attachment delete action.
+ * Adjust metadata for Attachment delete action.
*
* @param $spec
*/
}
/**
- * Delete attachment.
+ * Delete Attachment.
*
* @param array $params
*