From application page - upload multiple documents to library programmatically - then get their IDs?

Dotaz From application page - upload multiple documents to library programmatically - then get their IDs?

  • Tuesday, April 03, 2012 9:07 PM
     
     

    Hi there,

    SharePoint 2010 - Visual Studio 2010 - Application page:

    - I need to present users with an application page where they can browse and select multiple files and then upload them at once.
    - After the upload, the users should see the integer IDs of the files they just uploaded.

    Your help is appreciated. Thanks folks

All Replies

  • Tuesday, April 03, 2012 10:48 PM
     
     

    Hi,

    You can call Add method which takes in the following parameters. I dont have acces to environment, so the following snippet will have to be corrected if needed.

    SPFile myFile = myFilesCollection.Add(string urlOfFile, Stream file, Hashtable properties, bool overwrite);

    To get the IDs, do myFile.Item.ID;

    http://msdn.microsoft.com/en-us/library/ms454248.aspx

  • Saturday, April 14, 2012 11:52 PM
     
     

    Thanks Sangeetha,

    Do you know how to show the control to upload multiple files please?

    Thanks :-)