Methods |
public
|
__construct(
StreamInterface|resource|string|null $content,
?string $name = null,
?string $filename = null,
?string $mediaType = null,
?string $fallbackFilename = null,
)
Creates a new HttpMultipartStreamPart object
Creates a new HttpMultipartStreamPart object
Overriden by
|
#
|
public
static
|
fromFile(
string $filename,
?string $name = null,
string|null $uploadFilename = null,
string|null $mediaType = null,
?string $fallbackFilename = null,
): self
Creates a new HttpMultipartStreamPart object backed by a local file
Creates a new HttpMultipartStreamPart object backed by a local file
Parameters
$uploadFilename |
Default: basename($filename)
|
$mediaType |
Default: mime_content_type($filename) ,
application/octet-stream on failure.
|
|
#
|
protected
static
|
getFileMediaType(string $filename, ?string $mediaType = null): string
Get $filename's MIME type if $mediaType is null, $mediaType otherwise
Get $filename's MIME type if $mediaType is null, $mediaType otherwise
|
#
|
public
|
getName(): string
Get the field name of the part
Get the field name of the part
Implements
|
#
|
public
|
getFilename(): ?string
Get the filename of the part
Get the filename of the part
Implements
|
#
|
public
|
getFallbackFilename(): ?string
Get the ASCII fallback filename of the part
Get the ASCII fallback filename of the part
Implements
|
#
|
public
|
getMediaType(): ?string
Get the media type of the part
Get the media type of the part
Implements
|
#
|
public
|
getContent(): StreamInterface
Get the content of the part
Get the content of the part
Implements
|
#
|
public
|
withName(string $name): HttpMultipartStreamPartInterface
Get an instance with the given field name
Get an instance with the given field name
Implements
|
#
|
protected
|
filterFallbackFilename(?string $fallbackFilename, ?string $filename): ?string
Get $filename if $fallbackFilename is null and $filename is valid per
[RFC6266] Appendix D, $fallbackFilename otherwise
Get $filename if $fallbackFilename is null and $filename is valid per
[RFC6266] Appendix D, $fallbackFilename otherwise
Throws
|
#
|
protected
|
filterContent(StreamInterface|resource|string|null $content): StreamInterface
|
#
|