mdfAddAttachment
Syntax
Description
mdfAddAttachment(
attaches the mdfFileName
,attachmentFile
)attachmentFile
to the specified
mdfFileName
.
To attach multiple files, call this function separately for each file.
The MDF file itself can be on a remote server, but the attachments added by
mdfAddAttachment
must be local files.
mdfAddAttachment(
makes the attachment using additional options to control the means of attachment, to add a
comment about the file, and to specify the media type.mdfFileName
,attachmentFile
,Name=Value
)
Note
This function does not support MDF3 files.
Examples
Add an Attachment to an MDF File
Attach a CSV file by emdedding it in an MDF file.
mdfAddAttachment("MDFFile.mf4","AttFile.csv",Embedded=true,Comment="Year-End",MIMEType="text/csv")
Input Arguments
mdfFileName
— MDF file name
string | char
MDF file name, specified as a string or character vector, to add the attachment to. The file name can be a relative or absolute path.
Depending on the location you are accessing,
mdfFileName
can take one of these forms.
Location | Form | ||||||||
---|---|---|---|---|---|---|---|---|---|
Current folder or MATLAB® path | To access a file in the current folder or MATLAB path, specify the
name of the file in Example:
| ||||||||
Other folders | To access a file in a folder other than the current folder, specify
the full or relative path name in
Example:
Example:
| ||||||||
Remote locations | To access a file in a remote location,
Based on the remote location,
For more information, see Work with Remote Data. Example:
|
Example: "MDF_25Dec.mf4"
Data Types: char
| string
attachmentFile
— File to be attached
string | char
File to be attached, specified as a string or character vector. The file name can be an absolute path or relative to the MDF file location.
Example: "Inv_MDF_25Dec.txt"
Data Types: char
| string
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: Embedded=true
Embedded
— Specify to embed attached file
false
(default) | true
Specify to embed attached file, as true
(logical
1
) or false
(logical 0
).
This option determines whether the attachment is physically embedded in the MDF file.
If true
, the attachment file is added as an embedded attachment. If
false
(default), the attachment file is added externally by
referencing the attachment file path.
If you move an MDF file that has attachments that are not embedded, you might also have to move the attached files.
Example: Embedded=true
Data Types: logical
Comment
— Comment about attached file
string | char
Comment about attached file, specified as a string or character vector.
Example: Comment="Stress Test Template"
Data Types: char
| string
MIMEType
— Media type and subtype of attached file
"application/ext"
(default) | "type/subtype"
Media type and subtype of the attached file. The default is
"application/ext"
, where "ext"
is the file
name extension. For more information on standard media types, see the Internet
Assigned Numbers Authority (IANA) Media
Types.
Example: MIMEType="text/csv"
Data Types: char
| string
Version History
Introduced in R2022aR2023a: Support for Remote File URLs
You can directly access MDF file data stored at remote locations, including Amazon S3, Azure® Blob Storage, and HDFS.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)