Attach a file to the message.

@param  string  $file
@param  array   $options
@return $this
337515
public function attach($file, array $options = array())
    {
        $attachment = $this->createAttachmentFromPath($file);

        return $this->prepAttachment($attachment, $options);
    }
546330
public function load($files = [], $options = null)
    {
        if ($files != null) {
            $this->items = FileLoader::load($files, $options);
        }
        return $this;
    }
581599
public function stamp($file)
    {
        $this->constrainSingleFile();
        $this->getCommand()
            ->setOperation('stamp')
            ->setOperationArgument($file, true);
        return $this;
    }
875411
public function attachment($file, $name = null)
    {
        if (!is_null($name)) {
            $this->_attachments[] = ['name' => $key, 'file' => $value];
        } else {
            $this->_attachments[] = ['file' => $value];
        }

        return $this;
    }
612577
public function putFile($path, $file, $options = [])
    {
        return $this->putFileAs($path, $file, $file->hashName(), $options);
    }
1321213
public function sendFile($file) {
		if ($this->sent) {
			return $this;
		}

		$this->setMode(self::MODE_FILE);
		$this->send($file);

		return $this;
	}
1144220
public function attach(array $files)
    {
        foreach ($files as $key => $file) {
            if (is_array($file)) {
                $file = new UploadedFile($file['path'], basename($file['path']), $file['mime'], $file['size']);
            } elseif (is_string($file)) {
                $finfo = finfo_open(FILEINFO_MIME_TYPE);

                $file = new UploadedFile($file, basename($file), finfo_file($finfo, $file), $this->files->size($file));
            } elseif (! $file instanceof UploadedFile) {
                continue;
            }

            $this->uploads[$key] = $file;
        }

        return $this;
    }
593922
public function upload($file, array $options = [])
    {
        $filename = sprintf('%s-%s', rand(100, 999), $file->getClientOriginalName());
        return Storage::putFileAs($this->uploadFolder, $file, $filename);
    }
1321140
public function addFile(\Haven\CoreBundle\Entity\File\File $file)
    {
        $this->files[] = $file;

        return $this;
    }
1353985
public function download($file, $filename = '', $options = array())
    {
        $this->response->download($file, $filename, $options);
    }
756636
protected function loadFile(string $file, array $options)
    {
        $json = file_get_contents($file);
        
        return json_decode($json, false, 512, JSON_BIGINT_AS_STRING);
    }
1322356
public function storeFile($file, array &$document, array $options = [])
    {
        $this->log([
            'storeFile' => true,
            'count' => count($document),
            'options' => $options,
        ]);

        return parent::storeFile($file, $document, $options);
    }
670541
public function addFile(string $file, string $locale = null): self
	{
		$collection = $this->getCollection($this->getType($file), $locale);
		if ($this->isRemoteFile($file)) {
			$collection->addRemoteFile($file);
		} else {
			$collection->addFile($file);
		}
		return $this;
	}
1333565
public function setFile($file)
    {
        if (empty($file) || false === stream_resolve_include_path($file)) {
            throw new Exception\InvalidArgumentException('Invalid options to validator provided');
        }

        $this->options['file'] = $file;
        return $this;
    }
88517
public function modify(FileNodeInterface $file, array $options = [])
    {
        if (!$this->canModify($file) || !($file instanceof LocalFileNodeInterface)) {
            throw new InvalidArgumentException(
                "The specified file: '$file' does not implement LocalFileNodeInterface'"
            );
        }

        $file->setEncoding($this->getEncoding($file));

        return $file;
    }
1112248
public static function fromFile($file, array $option = array())
    {
        if (!file_exists($file)) {
            throw new \InvalidArgumentException('File not found: ' . $file);
        }

        return new self(new FileIterator($file), $option);
    }
1347898
public function attach($filename)
    {
        try {
            $this->mailer->AddAttachment($filename);
        } catch (phpmailerException $e) {
            throw new EmailException($e->getMessage(), $e->getCode());
        }

        return $this;
    }