DOWNLOADINFOPATH

Used specificity to download a InfoPath form from a document library.

Syntax

byte[] DOWNLOADINFOPATH(string listName, string file, [double version = 0]);

Example: to download the InfoPath form named myform.xml from document library Shared Documents:

CALL DOWNLOADINFOPATH('Shared Documents', 'myform.xml');

It is also possible to download a specific version of a form if versioning has been enabled on the document library. Available versions can be listed with the GETVERSIONS procedure.

Example: to download version 4.0 of the InfoPath form named myform.xml in document library Shared Documents:

CALL DOWNLOADINFOPATH('Shared Documents', 'myform.xml', 4.0);

The procedure returns a scalar byte array that can be written to disk.

Example: to download binary content, simply use:

Download InfoPath

using (var connection = new SharePointConnection(connectionString))
{
    connection.Open();
    using (var command = new SharePointCommand(@"CALL DOWNLOADINFOPATH('Shared Documents', 'myform.xml')", connection))
    {
        byte[] data = (byte[])command.ExecuteScalar();
        Console.WriteLine("Date length = " + data.Length);
    }
}

Code result

Date length = 7262


Skip Navigation Links.

Visa     MasterCard