public function file($file, $type, $filename = null)
    {
        $this->type = $type;

        if(is_file($file))
        {
            $this->payload['file'] = ['name' => $type, 'contents'=> fopen($file, 'r')];
            if($filename)
                $this->payload['file']['filename'] = $filename;
        }
        else
            $this->payload[$type] = $file;

        return $this;
    }