SharePoint 2010 SP.FileCreationInformation() in javascript client object model

2.7k views Asked by At

I try upload document to sharepoint document library using JCOM, but I have problem with metadata: brower console say "TypeError: SP.FileCreationInformation is not a constructor" and give link on "this.fi = new SP.FileCreationInformation();"

    <SharePoint:ScriptLink ID="ScriptLink1" runat="server" Name="SP.js" Localizable="false" OnDemand="False" LoadAfterUI="True"></SharePoint:ScriptLink>
<SharePoint:ScriptLink ID="ScriptLink2" runat="server" Name="SP.Core.js" Localizable="false" OnDemand="False" LoadAfterUI="True"></SharePoint:ScriptLink>
<SharePoint:ScriptLink ID="ScriptLink3" runat="server" Name="SP.Runtime.js" Localizable="false" OnDemand="False" LoadAfterUI="True"></SharePoint:ScriptLink>
<SharePoint:ScriptLink ID="ScriptLink4" runat="server" Name="SP.Debug.js" Localizable="false" OnDemand="False" LoadAfterUI="True"></SharePoint:ScriptLink>

<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>

<script type="text/javascript">
    $(document).ready(
        function () {
            ExecuteOrDelayUntilScriptLoaded(DDLBindData, "sp.js");
        }
    );

    var array = [];
    var counter = 1;

    function DDLBindData() {
        var clientContext = new SP.ClientContext.get_current();
        var web = clientContext.get_web();

        clientContext.load(web);
        clientContext.executeQueryAsync(Function.createDelegate(this, this.OnQuerySucceeded), Function.createDelegate(this, this.OnQueryFailed));

        this.listCollection = web.get_lists();
        this.list = this.listCollection.getByTitle("TestLib");
        this.contentTypeCollection = this.list.get_contentTypes();

        this.fi = new SP.FileCreationInformation();

        clientContext.load(this.contentTypeCollection);
        clientContext.executeQueryAsync(Function.createDelegate(this, this.OnQuerySucceeded), Function.createDelegate(this, this.OnQueryFailed));
    }

but intellisence show me other metod like FileCreationInformation

1

There are 1 answers