[This is preliminary documentation and is subject to change.]
Method that creates a new ContentSpecification based on a physical file on the local filesystem.
If a mimetype is specified in the parameters, the content file will be saved in MultiArchive with this mimetype instead of the mimetype of the actual physical file.
Namespace: MultiArchive.SDK.ServiceUtils
Assembly: MultiArchive.SDK (in MultiArchive.SDK.dll) Version: 1.2.30.413 (1.2.30.413)
Syntax
C# |
public void AddContentSpecification(
FileSystemInfo content,
string mimeType
)
|
Visual Basic |
Public Sub AddContentSpecification (
content As FileSystemInfo,
mimeType As String
)
|
Visual C++ |
public:
void AddContentSpecification(
FileSystemInfo^ content,
String^ mimeType
)
|
Parameters
-
content
- Type: System.IO..::..FileSystemInfo
A reference to a physical file on the local filesystem which is to be attached to the created item.
-
mimeType
- Type: System..::..String
A user specified mimetype for the file being attached. This overrides the mimetype of the physical file.
Examples
C# |
Copy
|
class TestClass
{
public static void Main()
{
ItemSpecificationBuilder myBuilder = new ItemSpecificationBuilder();
FileInfo info = new FileInfo(@"C:\HelloWorld.txt");
myBuilder.AddContentSpecification(info, "text/plain");
}
}
|
Exceptions
See Also