public static function unsigned_upload($file, $upload_preset, $options = array()) { return Uploader::upload($file, array_merge($options, array("unsigned" => TRUE, "upload_preset" => $upload_preset))); }
function test_upload_preset() { // should support unsigned uploading using presets $api = new \Cloudinary\Api(); $preset = $api->create_upload_preset(array("folder" => "upload_folder", "unsigned" => TRUE)); $result = Uploader::unsigned_upload(self::LOGO_PNG, $preset["name"]); $this->assertRegExp('/^upload_folder\\/[a-z0-9]+$/', $result["public_id"]); $api->delete_upload_preset($preset["name"]); }