Cloudinary\Uploader::unsigned_upload PHP Method

unsigned_upload() public static method

public static unsigned_upload ( $file, $upload_preset, $options = [] )
    public static function unsigned_upload($file, $upload_preset, $options = array())
    {
        return Uploader::upload($file, array_merge($options, array("unsigned" => TRUE, "upload_preset" => $upload_preset)));
    }

Usage Example

Esempio n. 1
0
 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"]);
 }