Codesleeve\Stapler\Attachment::setUploadedFile PHP Method

setUploadedFile() public method

Accepts the following inputs: - An absolute string url (for fetching remote files). - An array (data parsed from the $_FILES array), - A Symfony uploaded file object.
public setUploadedFile ( mixed $uploadedFile )
$uploadedFile mixed
    public function setUploadedFile($uploadedFile)
    {
        if (!$this->keep_old_files) {
            $this->clear();
        }
        if ($uploadedFile == STAPLER_NULL) {
            $this->clearAttributes();
            return;
        }
        $this->uploadedFile = FileFactory::create($uploadedFile);
        $this->instanceWrite('file_name', $this->uploadedFile->getFilename());
        $this->instanceWrite('file_size', $this->uploadedFile->getSize());
        $this->instanceWrite('content_type', $this->uploadedFile->getMimeType());
        $this->instanceWrite('updated_at', new DateTime());
        $this->queueAllForWrite();
    }