matlab.net.http.io.FileProvider Class
Namespace: matlab.net.http.io
Superclasses: matlab.net.http.io.ContentProvider
, matlab.mixin.Copyable
ContentProvider to send files
Description
Use a FileProvider
object as a convenient way to send one or more files to
a server.
The matlab.net.http.io.FileProvider
class is a handle
class.
Creation
Description
providers = FileProvider(
constructs
an array of files
)FileProviders
, one for each file in the
files
array. Each entry sends one file to the server.
To terminate the file transfer before reaching the end of the file, set the
FileSize
property to the number of bytes desired. To decide where
to end the transfer based on the file contents while it is being read, write a subclass
and override getData
to
examine the data being read and set the stop
return value to end the
transfer.
providers = FileProvider(
specifies options for opening the files.files
,permission
,machineformat
,encoding
)
providers = FileProvider(
constructs
fileIds
)FileProviders
specified by file identifiers. The files are read starting
at the current file position indicator to the end of the file. The file identifiers are
not closed when the transfer is complete. This method is useful if the file is already
open, or when you want to transfer just the trailing part of the file. To do this, open
the file, set the file position indicator to the start of the data in the file that you
want to transfer, and then pass that file identifier into this constructor. You can also
set FileSize
to limit the total number of bytes or write a subclass
to control when to end the transfer.
Input Arguments
Properties
Methods
More About
Version History
Introduced in R2018a
See Also
RequestMessage
| MessageBody
| MultipartProvider
| MultipartFormProvider
| FileConsumer
| fopen
| getData