Uploading Multiple documents to custom list programmatically

HI,
I am using VS 2010 and C#, SharePoint 2010.
I have a custom list ( not using document library).
I am using a visual web part, in which i have added a asp:file upload control, which has Allow multiple set to true.
How to upload multiple files to custom list programmatically using the asp:file upload control?
Thanks

See if any of the below links give you some pointers
http://kamilamirul.wordpress.com/2013/01/19/multiple-upload-file-programmatically-using-gridview/
http://nestorrg-blogs.itequia.com/2010/01/upload-multiple-files-attached-to.html
http://social.technet.microsoft.com/wiki/contents/articles/2990.programatically-upload-multiple-file-in-sharepoint-list-part-2.aspx
http://www.c-sharpcorner.com/UploadFile/Freddy_Khalaf/multiple-attachment-custom-control-in-sharepoint/
http://www.c-sharpcorner.com/UploadFile/sarav82/MOSS11072007065009AM/MOSS.aspx
Geetanjali Arora | My blogs |

Similar Messages

  • Uploading Multiple Documents To a List Item sharepoint 2010

    hi Guys ,
    Is there a way we can enable (out of the box )Uploading Multiple Documents To a List Item sharepoint 2010 ?
    cheers

    No, There is no OOB way to do the same you have to build a custom Page/Control OR customise OOB Form to attache multiple files and that will be through integration of ajax based control (multiple file uploader.)
    the other way to do the same is provision a custom field. we have done this for our many  clients.
    Hi, I also encountered the same problem, could u pls provide detailed information by a custom field?

  • Upload multiples attachments in sharepoint list programmatically

    Hi sir,
    I want To upload multiple attachments in sharepiont list programmatically.plesse suggest me
    vijay

    Hello,
    The TechNet Sandbox forum is designed for users to try out the new forums functionality. Please be respectful of others, and do not expect replies to questions asked here.
    As it's off-topic here, I am moving the question to the
    Where is the forum for... forum.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Uploading multiple documents into sharepoint list item with REST in sharepoint 2013 using content editor web part :

    hi ,
    i am trying to upload multiple document files into sharepoint list item. I followed below link for implementaion.
    http://techfindings-prem.blogspot.in/search/label/jquery.multifilejs
    It was working for sharepoint hosted app.
     This complete code is written within content edito web part.
    It was working when i was in root site collection with below change (hard coded the root level url) in code in "UploadFile" function.
    var scriptbase = "http://servername" + "/_layouts/15/";
                console.log(' File size:' + bytes.length);
                $.getScript(scriptbase + "SP.RequestExecutor.js", function () {
                    var createitem = new SP.RequestExecutor("http://servername");
                    createitem.executeAsync({
                        url: "http://servername/sites/cpg/" + "/_api/web/lists/GetByTitle('SalesRecord')/items(" + attachmentitemid + ")/AttachmentFiles/add(FileName='"
    + fileName + "')",
                        method: "POST",
                        binaryStringRequestBody: true,
                        body: binary,
                        success: fsucc,
                        error: ferr,
                        state: "Update"
                    function fsucc(data) {
                        //alert( data.statusText + "\n\n" + data.responseText);
                        console.log(data + ' uploaded successfully');
                        deferred.resolve(data);
                    function ferr(data) {
                        //alert( data.statusText + "\n\n" + data.responseText);
                        console.log(fileName + "not uploaded error");
                        deferred.reject(data);
    But the issue came in picture when i was working with the other site collection instead of root one. The url was like below.
    "http://servername/sites/cpg/". This time i need to be there within "cpg" site collection. 
    Now if i hard code the url as i did above my code gets break here while come to below line
     $.getScript(scriptbase + "SP.RequestExecutor.js", function () {
    I am getting error when i used below code:
    var scriptbase = "http://servername" + "/_layouts/15/";
     $.getScript(scriptbase + "SP.RequestExecutor.js", function () {
                    var createitem = new SP.RequestExecutor("http://servername");
                    createitem.executeAsync({
                        url: "http://servername/sites/cpg/" + "/_api/web/lists/GetByTitle('SalesRecord')/items(" + attachmentitemid + ")/AttachmentFiles/add(FileName='"
    + fileName + "')",
                        method: "POST",
                        binaryStringRequestBody: true,
                        body: binary,
                        success: fsucc,
                        error: ferr,
                        state: "Update"
                    function fsucc(data) {
                        //alert( data.statusText + "\n\n" + data.responseText);
                        console.log(data + ' uploaded successfully');
                        deferred.resolve(data);
                    function ferr(data) {
                        //alert( data.statusText + "\n\n" + data.responseText);
                        console.log(fileName + "not uploaded error");
                        deferred.reject(data);
    Please hekp in this case. This complete code is written within content edito web part. 
    Regards:
    Sanjay Joshi

    Hi,
    According to your post, my understanding is that you have an issue about upload multiple documents files into library vai REST API.
    As you have said, you have used the hard code url in your code.
    How about use the _spPageContextInfo.webAbsoluteUrl method to get the url?
    I have used this method to get the url, then use the code in the article you have pasted within a content editor web part to upload the files.
    You can replace the hard code url with the _spPageContextInfo.webAbsoluteUrl method, then check whether it works.
    Thanks,
    Jason
    Jason Guo
    TechNet Community Support

  • Can't see 'Upload Multiple Document' option in sharepoint 2013

    After upgrading Sharepoint 2010 to 2013, i can't see 'Upload Multiple Document' option under files tab. I have downloaded and place the file 'STSUPLD.DLL' into Office14 and Office15 folder but IE is not asking me to run any microsoft ActiveX control as mentioned here
    http://thuansoldier.net/?p=2289
    I am using  Office 2010 with IE9 (32 bit) .
    Am i missing anything ?

    Hi, 
    According to your post, my understanding is that you could not see the “Upload Multiple Document” option in SharePoint 2013.
    In SharePoint 2013 the “Upload Multiple” Options has been depreciated. As we all known, there are two alternative ways to Upload multiple documents:option
    1 -  Using the drag-and-drop functionality, option 2 - Windows Explorer view.
    You can upgrade your IE from IE9 to IE10 then check whether it works.
    You can also use the Windows Explorer view to upload multiple documents.
    You will probably get the following error.
    To resolve this add the SharePoint site as Trusted in your Browser and Make sure that the WebClient service is running. To do this, follow these steps:
    Click Start, click Run, type services.msc, and then press Enter.
    In the list of services, locate the WebClient service, and then make sure that its status in the Status column is set to Started. If its status is not set to Started, double-click WebClient, click Start, and then click OK.
    Once done restart the browser and try opening the Windows Explorer again. In the Windows Explorer you can copy and paste Multiple documents as done in earlier SharePoint versions.
    For more information:
    http://www.learningsharepoint.com/2012/11/29/how-to-upload-multiple-documents-in-sharepoint-2013/
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Upload Multiple documents in SharePoint document Library not working

    Hi All,
            I have folder on my desktop which consists of nested folders and files(Total 11 files) .And when I select "Upload multiple files" option to upload documents and drag the folder from the desktop in pop-up window .
             The sharepoint document library uploads only 1 file among all the nested folders from 11 files.Can any one help me how can I solve this
    Thanks, Quality Communication Provides Quality Work. http://siddiq-sharepoint2010.blogspot.in/ Siddiqali Mohammad .

    Hi,
    I understand you encountered the issue when use "Upload Multiple Documents" to Drag Files and Folders to upload window.
    When you say "The sharepoint document library uploads only 1 file among all the nested folders from 11 files", do you mean you have drag all files and folders to the window, while only 1 file is uploaded sucessfully? Or you cannot find all expected
    folders and files?
    Please manually open "Windows Explorer" to locate files and drag files from "Windows Explorer", instead of using the "Open window"
    opened by "Browse for files instead" as below:
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Upload multiple documents option is not visible for one user in SharePoint 2007.

    Hi,
    For one user Upload multiple documents option is not visible.
    We are using SharePoint 2007 environment.
    User is using IE 9 32 bit,Office 2010.
    I did repair office 2010.
    Active x controls are enabled.
    Please anyone help me on this.
    Thanks,
    Ashok

    Hi,
    According to your post, my understanding is that after client upgraded to Office 2013 the option for Upload multiple document was grayed out.
    I try to reproduce the issue in my environment, however everything works well.
    My configuration of system is:
    Windows 8.1;
    IE11;
    Office 2013 32bit.
    Please repair the Office 2013 to check whether it works.
    In addition, there are many thing you need to check. Please refer to:
    http://sharepointknowledgebase.blogspot.com/2013/09/upload-multiple-documents-is-disabled.html
    Here is a similar thread for your reference:
    http://social.msdn.microsoft.com/Forums/en-US/1a5af332-ed21-41ee-bf64-9122a7439623/sharepoint-not-activating-stsuplddll-upload-mutliple-documents-greyed-out?forum=sharepointgeneralprevious
    More information:
    "Upload Multiple Documents" is disabled in Document Library
    SharePoint 2010 : How to Enable Uploading Multiple Documents Functionality
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • STSUPLD.DLL not recognizing as an add-on; upload multiple documents disabled

    On my client system, Windows XP, Office 2007 and IE8 is installed. It is a 32 bit system. On the Sharepoint site, "upload multiple document" feature is disabled. After searching for the cause, I came to know about the STSUPLD add-on that needs
    to be enabled otherwise it remains greyed out. So I copied the DLL file to C:/.../Office12/STSUPLD.DLL
    IE does not detect any add-on when I start a new browser session. Between copying the DLL, and starting a new browser session, followed by checking Tools-->manage add-ons, am I missing an important step? (like installing...etc.)
    Thanks

    easy way is, if you can install the Office client on the server, the control will be available.
    also check this post for further detail:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/1a5af332-ed21-41ee-bf64-9122a7439623/sharepoint-not-activating-stsuplddll-upload-mutliple-documents-greyed-out?forum=sharepointgeneralprevious
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Help Required - Upload Multiple Documents functionality sometimes disappears in SharePoint 2010

    Hi All,
    We have a web application created in SharePoint 2010 & there we were facing an issue of not able to Upload multiple documents. After doing search on google, we have found that
    pre-requisites for this functionality to be working properly are as follows:
    Client Integration needs to be enabled for the web application.
    The STSUpld.UploadCtl IE add-in must be enabled. (located in C:\Program Files (x86)\Microsoft Office\Office12)
    The 32 bit version of Internet Explorer. The 64 bit version does not support it and neither do other, non IE, browsers.
    Office 2003 or newer on the client.
    After meeting all the above requirements, We are now able to see the Upload Multiple Documents link but we are failing in below 2 scenarios:
    On some machines it is working fine & on some it is not.
    On some machines, this option is available for sometime & sometimes it disappears.
    If any one of you have experienced the same problem, then please help us with your valuable suggestions & possible solution for it.

    Hi Manish,
    We've just been experiencing your initial issue with Office 2007 clients not being able to use the multi-file upload functionality.  Sure enough....turning on presence information in Central Admin fixes the issue.  The strange thing is though that
    when presence is turned off, Office 2003 and 2010 clients still work fine and it's only 2007 clients that fail.  Also this issue appeared to only exist for us inside applications that have been upgraded from MOSS2007 to SP2010.  Any new applications
    of even new site collections within an upgraded application worked fine across all 3 Office versions.
    Coincidently, we're also experiencing the more recent issue you've come across with files not uploading after clicking OK in the ActiveX.  Nothing happens.  Office 2010 clients work fine but 2003 and 2007 clients just don't upload the selected
    files.  We've found a workaround which "fixes" the issue but brings it's own set of problems so it's not ideal.  Here's what we've done...
    1. Open IIS, and navigate to the web where you want to use multi-file upload
    2. Select Handler Mappings and Add Script Map
    3. Set Request Path - shtml.dll
    4. Set Executable - C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\SHTML.dll
    5. Set the name to something meaningful - Multi File Upload
    6. Leave the Request Restrictions as default
    This should fix the issue with files not uploading but unfortunately it also prevents SharePoint Designer from accessing the site.  For the application where we desperately need multi-file upload we can manage without SPD access so it's not the end
    of the world but not ideal.  We've actually got an outstanding incident logged with Microsoft to resolve this issue but they've yet to find a solution for us.  We suggested to MS that we update authentication to Kerberos from NTLM and retry as we
    seem to be getting 401 errors in the call stack so thought that could be related.  We've not yet configured Kerberos so I'm not sure whether this is a solution or not.
    One other point worth mentioning is that SharePoint Designer 2010 (which is free) installs the latest version (14) of the Upload ActiveX and with this installed the uploads work as expected.  Also if you have Silverlight and SPD2010 installed then you
    get a Silverlight control to do the upload which also works fine.  Again, not ideal as rolling out SPD 2010 to affected clients isn't really a suitable solution.
    Sorry I can't be any more help.  Hopefully my findings might point you in the right direction.  If you do find a solution (other than the IIS handler mapping) then please re-post here,
    Good luck,
    Ben

  • Display data from multiple document Libraries in List View Webpart

    Hi All,
    I want to display data from multiple document libraries into one list view webpart(custom i have created)
    I went through the following link http://blogs.msdn.com/b/ramg/archive/2009/04/22/implementing-a-simple-cross-site-collection-list-view-webpart.aspx
    but it tells to display only from one document library.
    My motive behind displaying data in the list view webpart is to achieve the functionality of Check In ,Check Out and other OOB features.
    With Regards,
    Jaskaran Singh

    Hi,
    As there is no such OOTB feature, a workaround is to create a visual web part to gather items from libraries and implement functionalities like Check in, Check out files
    in different libraries.
    The links below will provide more details:
    Create Visual Web Parts in SharePoint
    2010
    A demo about displaying list items in visual web part:
    http://www.dotnetcodesg.com/Article/UploadFile/2/217/Web%20Part%20in%20SharePoint%20To%20Show%20All%20List%20and%20List%20Items.aspx
    About the Check In and Check Out:
    How to Check In a document programmatically
    SPFile.CheckIn method
    and SPFile.CheckOut method
    Best regards
    Patrick Liang
    TechNet Community Support

  • Check boxes to select multiple documents on report list in 4,6C......

    Hello,
    I am working on 46C. When I execute FB03 List option, I get list of Document numbers. I am in the process of developing a custom report, so when I do that, along with the document numbers, I also get small checkbox besides it, so that I can select multiple documents.
    I then I have a button on application toolbar when pressed should execute cetain logic.
    Regards,
    Jainam.

    Hi,
    Try this way.
    REPORT ztest_notepad.
    TYPE-POOLS:icon.
    DATA: BEGIN OF it_mara OCCURS 0,
           check TYPE char4,
           matnr TYPE mara-matnr,
           ersda TYPE mara-ersda,
         END OF it_mara.
    DATA:str TYPE string.
    START-OF-SELECTION.
    SELECT * FROM mara INTO CORRESPONDING FIELDS OF TABLE it_mara UP TO 100 ROWS.
    LOOP AT it_mara.
       it_mara-check = '@T9@'. "code for empty checkbox
       WRITE:/ it_mara-check HOTSPOT ON,
               it_mara-matnr,
               it_mara-ersda.
       HIDE:it_mara-check,
            it_mara-matnr,
            it_mara-ersda.
    ENDLOOP.
    AT LINE-SELECTION.
    it_mara-check = '@R7@'."Code for checked checkbox.
    MODIFY LINE sy-lilli FIELD VALUE it_mara-check.
    READ TABLE it_mara INDEX sy-lilli.
    IF sy-subrc EQ 0.
       str = sy-lilli.
       CONCATENATE 'Row no' str 'selected' INTO str SEPARATED BY space.
       MESSAGE str TYPE 'I'.
    ENDIF.
    Thanks
    Venkat.O

  • Uploading multiple documents using file upload option

    Hi,
      I am new to BSP in file upload.Here i am trying to upload documents and Archiving the documents.At one time i am able to uplaod one document.Is there anyway of uploading of multiple documents from the same File upload control in the same session.and keeping the documents that uploaded in the page.
      Hope you will answer.Need urgent reply.
        Regards
       Usman

    before answering your question, a request
    can you reply/award points/close previous thread opened by you.
    coming to your question, check out the below given link.
    http://www.15seconds.com/issue/990723.htm
    Regards
    Raja

  • Upload multiple documents missing

    The upload documents option is missing for a user that has Office 2012, Sharepoint 2010  and IE 9 on their local machine. It is working fine on the server that has Office 2010, Sharepoint 2010 and IE9. So it looks like it is either an Office 2012
    issue or a setting on IE but I have no idea what. Could their be a compatibility issue between Sharepoint 2010 and Office 2012? has anyone else had this problem?
    thanks.

    Your question is a bit unclear:
    There isn't an office 2012 that i know of. Do you mean Office 2013?
    Does the user have a development SharePoint instance installed on a Windows 7 machine? The more normal exaple would be that you have one SharePoint 2010 installation on the server and a user accessing the site from a Windows 7 desktop.
    Is the user able to upload single documents using the Upload Document button on the ribbon but is unable to upload multiple items?
    If all of that is true: The user is probably missing Silverlight or the steps in the link Amit included should be followed.

  • Upload multiple documents to SharePoint library in parallel using c#

    Hi Team,
    We are trying to upload thousands of documents to SharePoint library programatically.I am able to achieve this sequentially . Please help me in achieving this parallely and improve the performance.
    Thanks in Advance.

    You can try new .net framework async/await feature as described at
    http://blogs.msdn.com/b/cdndevs/archive/2013/12/18/c-async-and-await-why-do-we-need-them-part-1.aspx. However, you need to limit your concurrent requests, you don't want to span 100 files upload in parallel.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • Getting error while uploading multiple files in sharepoint hosted app in 2013 with REST API

    Hi All,
    In one of my tasks, I was struck with one issue, that is "While uploading multiple files into custom list with REST API".
    Iam trying to upload multiple files in library with REST calls for an APP development, my issue is if i wants to upload 4 image at once its storing only
    3 image file and further giving "Conflict" error". Below is the attached screenshot of exact error.
    Error within screenshot are : status Code : 409
    status Text :conflict
    For this operation i am uploading different files as an attachment to an list item, below is the code used for uploading multiple files.
    my code is
    function PerformUpload(listName, fileName, listItem, fileData)
        var urlOfAttachment="";
       // var itemId = listItem.get_id();
        urlOfAttachment = appWebUrl + "/_api/web/lists/GetByTitle('" + listName + "')/items(" + listItem + ")/AttachmentFiles/add(FileName='" + fileName + "')"
        // use the request executor (cross domain library) to perform the upload
        var reqExecutor = new SP.RequestExecutor(appWebUrl);
        reqExecutor.executeAsync({
            url: urlOfAttachment,
            method: "POST",
            headers: {
                "Accept": "application/json; odata=verbose",
                "X-RequestDigest": digest              
            contentType: "application/json;odata=verbose",
            binaryStringRequestBody: true,
            body: fileData,
            success: function (x, y, z) {
                alert("Success!");
            error: function (x, y, z) {
                alert(z);

    Hi,
    THis is common issue if your file size exceeds 
     upload a document of size more than 1mb. worksss well for kb files.
    https://social.technet.microsoft.com/Forums/office/en-US/b888ac78-eb4e-4653-b69d-1917c84cc777/getting-error-while-uploading-multiple-files-in-sharepoint-hosted-app-in-2013-with-rest-api?forum=sharepointdevelopment
    or try the below method
    https://social.technet.microsoft.com/Forums/office/en-US/40b0cb04-1fbb-4639-96f3-a95fe3bdbd78/upload-files-using-rest-api-in-sharepoint-2013?forum=sharepointdevelopment
    Please remember to click 'Mark as Answer' on the answer if it helps you

Maybe you are looking for

  • HP Laserjet 4 -- Windows 8

    Just got new computer -- Windows 8 -- I have a HP Laserjet 4 printer It used to work on my old computer with Vista can't find driver for it HELP?? Dave

  • Preview box causes crashing

    I'm using Adobe Premier Pro CC through Creative Cloud. Whenever, I drop a new item into the Preview box, the program crashes. Heres the error Process:               Adobe Premiere Pro CS6 [632]  Path:                  /Applications/Adobe Premiere Pro

  • IE8 vs. my website

    As much as I hate to expose myself to the true web gurus in this forum who will most likely get a good laugh over my very novice attempts at websites and code, I need someone to tell me if there's any hope for fixing this site to work with IE 8 (or h

  • OSX Mail not checking for new mail on wake from Sleep.

    Since upgrading to 10.6.4, my iMac no longer checks for new mail when waking from sleep. I have to manually Get Mail, and then it keeps up to date as normal. RSS feeds get updated fine. I am using MobileMe mail. Any ideas? I have restarted Mail and r

  • Portal Restart after deploy

    Hi All, we have a problem, that we have to restart our portal every time we make modification to our Layout Control to get modification. do you know what we have to do, to not restart after every modification? thanks for help! regards Karol