Document Library Upload 'Choose Folder' programming Issues

Hello,
I have a document library with folders and subfolders and all folders have unique security inheritance applied. Administrator is able to upload to any folder using below dialog. I want everyone who does not have permission to the folders and subfolders to
upload file. So I decided to programmatically incorporate the ‘Choose Folder’ functionalities via SPSecurity.RunwithElivatedPrivillages(Delegate(){ “…” });
I incorporated fetching document library and populate hierarchies inside the security code so code run as system account. However when I call
LaunchPickerTreeDialog
it populates based on user permission and hence if user does not have permission to folder, it does not populate at
all.
How can I make sure to give this Upload file functionality to all users via dialog box with full permission so it generates all folders and subfolder of the document library when user select ‘Choose Folder’ option?
Please note that if I type the correct doc library folder url, it successfully uploads to any folders as my code is inside the elevated permission. It is not good approach to give textbox to end user to type as they might make a mistake, so I need to provide
a ‘Choose folder’ dialog functions but I want to run as elevated privileges as everyone who do not have permission also can upload the file.
I also tried using
http://howtosharepoint.blogspot.com/2010/02/sharepoint-2010-folder-selector-and.html but the following code can’t be resolved
if
(_hiddenSelectionField != null
&& !string.IsNullOrEmpty(_hiddenSelectionField.Value))
  _listUrl.Text = GetObjectUrl(_hiddenSelectionField.Value);
  _hiddenSelectionField.Value = string.Empty; }
How can I declare and make use of  hiddenselectionField and
ListURL in my webpart?
Thanks

There's always a few challenges when trying to get around SharePoint's security model. Your options would be to try to extend the LaunchPickerTreeDialog if it's not sealed or to write a custom folder picker control. If you go the custom route, you could
even include it directly on that upload page to avoid the additional clicks.
Dimitri Ayrapetov (MCSE: SharePoint)

Similar Messages

  • Moving documents with a workflow from a document library to a folder and back to the document library

    Hello all,
    I have created a document library with a folder inside of it.
    By means of a workflow, I could move a document that was in the document library to the folder using the action “update path and name”. Now I need to do the reverse path, that is, using a workflow I’d like to
    move the document that is now in the folder, back to the document library but I can´t find the action “update path and name”. Do you have any ideas on how to solve this?
    Thanks a lot!
    Regards.

    Hi Juan,
    For your issue, you can consider the actions as below:
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • FTP upload, choose folder to assign

    I'm trying to design an interface that does the following:
    1) Through FTP an admin uploads an image library to a unique folder they just created.
    2) The admin creates a user account
    3) The admin through their (PHP & MySQL) admin panel can browse to that new folder, choose it, and that library is assigned to the user account they just created (in a drop down list or something rather)
    I can achieve all this except for choosing the folder and or assigning it, I'm already using ADDT for everything else, figured I should ask, see if anybody's got any ideas,the closest thing I could come up with as far as choosing the folder is somehow using the upload image tool and reconfigure it to be used to choosing a folder.
    Appreciate any insight, thanks everyone. -Aaron

    ------
    Is there something standard in the developer toolbox that does just that?
    the path to whatever folder which you specify in e.g. the Image/File Upload behaviour or the Filelist Recordset can contain dynamic segements like the Session variable kt_login_id -- it´s that what you mean with "standard" ?
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • 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]

  • Multiple Document Library Issues

    Hi,
    Actually i am creating document libraries in SharePoint site by using SharePoint Service successfully.
    My issue is, 1st document library has been created with folder and creating 2nd document library with out folder. Now the 2nd document library is Show as a Child for 1st document library.
    If i would added folder in 2nd document library then both document library would show as like independent.
    For end users,it would looks like nested document library.
    How to resolve this issue.
    Thanks & Regards
    Poomani Sankaran

    Hi,
    Thanks for your reply.
    No way to create as you said. I am not giving url like "doclib1/doclib2". Even it is not possible to create doc lib inside another doc lib.
    The correct url is below.
    http://servername:port/sitename/doclib1
    http://servername:port/sitename/doclib2
    If both document libraries has folder then both are looks like independent.
    If both document libraries does not have folder means doclib2 is child of doclib1.
    but logically both are independent only. only by visual and looks its like parent and child.
    Thanks & Regards
    Poomani Sankaran

  • How to move files to Archive folder in same document library

    hi,
    we have one document library (Upload Documents) in that document library we have Archive Folder , when upload document to upload document library first we want check same document   name is there or not and check version also ,if the same document
    is there in that document library then move to that  document to Archive  folder  with  same version and add to document to  upload document library..
    ex:
    Document Lib name:---Upload document
    folder name-->Archive Folder
    Document: Test.txt and version is 1.0
    when upload  same document to document library the Test.txt file move to archive folder and add same document in upload document library with new version

    you can look at Item Adding Event receiver and before you add the new document do you check and move the document to archive folder 
    Hope that helps|Amr Fouad|MCTS,MCPD sharePoint 2010

  • Sharepoint 2010 - Archiving the files from one document library to another document library in sharepoint site

    I have a requirement to move the documents from one document library to another document library.
    Source Library - DocumentLib
    Destination Library - Archive
    Archive document library will have folders by fiscal year.
    Source documentlibrary has files from year 2012 till date.
    Archive folder will have folders by fiscal year -(fiscal year starts from July1st -June 30th )
    If the document is created date  between 1st  July 2012 -June 2013 then move the document to Archive document library and in  folder Fiscal Year 2013.
    If the document is created date  between 1st  July 2013 -June 2014 then move the document to Archive document library and in  folder Fiscal Year 2014.
    The structure of destination document library folder should be same as source document library.
    Please find attached the screenshot of the requirement.
    Files Type - Excel,pdf,microsoft outlook item
    Could we use Sharepoint designer workflow to achive this task?
    Any help on this will be appreaciated.

    Hi Asritha,
    According to your description, you want to create a workflow to meet the need.
    Per my knowledge, there is no built-in action which can move the documents from the current library to a folder in another library.
    I recommend to use the custom activity 'Copy List Item Extended' which need to be downloaded from
    http://spdactivities.codeplex.com/.
    Please per the steps below to deploy the custom activity to SharePoint:
    Download the activity form http://spdactivities.codeplex.com/
    Open Dos command prompt.
    Browse to the directory that you can access stsadm.exe. The default location in version 3.0 is C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\bin
    Type the stsadm commands: stsadm -o addsolution -filename C:\UsefulSPDWorkflowActivities_0.5.0\DP.Sharepoint.Workflow.wsp (“C:\UsefulSPDWorkflowActivities_0.5.0\” is the file path)
    Type the stsadm commands: stsadm -o deploysolution -name DP.Sharepoint.Workflow.wsp -allowgacdeployment -force -immediate 
    Open the Center Administration, Click System Setting->Manage Farm Solution-> dp.sharepoint.workflow.wsp->Deploy to the Web Application.
    After that, we can create a workflow to meet the need.
    Here is the detailed steps to create the workflow:
    Create a workflow associated with the Source Library DocumentLib and set the workflow to start when an item is created.
    Select If current item field equals value, change the settings to be If Current Item: Created is greater than 7/1/2012.
    Select If current item field equals value, change the settings to be If Current Item: Created is less than 6/30/2013.
    Select Copy List Item Extended, change the settings to be Copy item in Current Item to list at Fiscal Year 2013 folder url.
    Select Delete Item, change the settings to be Delete Item in Current Item.
    Select If current item field equals value, change the settings to be If Current Item: Created is greater than 7/1/2013.
    Select If current item field equals value, change the settings to be If Current Item: Created is less than 6/30/2014.
    Select Copy List Item Extended, change the settings to be Copy item in Current Item to list at Fiscal Year 2014 folder url.
    Select Delete Item, change the settings to be Delete Item in Current Item.
    Publish the workflow.
    Best regards.
    Thanks

  • Issue while creating a new web part page (Safeunit.aspx) within a folder located under a Document Library.

    Hi, I am facing an issue while creating a new web part page (Safeunit.aspx) within a folder (Safematic Seal Support Systems) located under a Document Library (Product Information Documents).
    The path I am explaining:
    Going to the Document Library (Product Information Documents) --> now inside that, clicking on a folder (Wet Seal Support
    Systems) --> now inside the folder clicking on another sub-folder (Safematic Seal Support Systems) --> Here I want the web page Safeunit.aspx
    Issue is that when I reach to the required destination, and want to create the web page by clicking on 'Site Action' --> 'Create' --> 'Web Part Page', now while selecting the Document Library name from the drop-down list, I do use 'Product
    Information Documents' since the folder is inside this library only; but that create the page directly under the 'Product Information Documents' library, not under the sub-folder (Safematic Seal
    Support Systems).
    FYI, it is SP2007 version.
    Kindly assist in this. Thanks in advance.

    I see that you have the namespaces reference in your code.
    I think you have changed the NameSpace name of your code to CreateSPFolder, change the reference in all your manifest, and other files to point to the current namespace name. It should help.
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

  • Unable to create a new folder in document library of SharePoint 2010

    Hi There,
    Need some help regarding an issue which is occurring after migration from SP 2007 to 2010.
    We have recently migrated a site to SP 2010, after migration whenever i tried to create a new folder in a document library it gives me an error message below
    SPException: Can not find the form to create default data for the list
        Microsoft.SharePoint.Utilities.SPUtility.ThrowSPExceptionWithTraceTag (UInt32 TagId, ULSCat traceCategory, resourceId String, Object [] resourceArgs) 28098007 
        Microsoft.SharePoint.ApplicationPages.ListFormRedirect.InitializeQueryStringMembers () 1764 
        Microsoft.SharePoint.ApplicationPages.ListFormRedirect.OnLoad (EventArgs e) +25 
        System.Web.UI.Control.LoadRecursive () 66 
        System.Web.UI.Page.ProcessRequestMain (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 2428
    All the document libraries which are created with the custom list template has this problem. 
    Moreover, I have verified and found Upload.aspx page is available in Forms folder of a document library. 
    Can someone help me in resolving this issue.
    Thank you in advance.
    Vikram
    vikram padigala

    Hi,
    All the document libraries which are created with the custom list template has this problem. 
    Did you mean you had a custom library template?
    Did the issue occur in the library which created use the out of the box template, such as use the Document Library template?
    You can check with the OOB template library to test whether they had the same issue.
    If the OOB template library works well, the issue may be related to the custom library template.
    You can try to recreate a new custom template to check whether it works.
    To quickly and accurately find the issue , you can also check the event log and ULS log to see if anything unexpected occurred.
    For SharePoint 2010, by default, ULS log is at
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Library - Documents displayed in wrong folder

    Hi all
    Another strange case:
    In a document libarary I have 50 folders. Each of them contain 2-3 documents. My view shows 30 elements per page.
    When I go to the next page to view the folders 31-50 everything seems to be OK. But when I go back to the first page again (1-30) the library shows the folders AND the contents of the folders. After reloading the page everything is OK.
    Any ideas how to fix this problem?
    Thanks.

    Hi Hemendra.
    Thanks for your reply.
    I made the following tests:
    - Created a new view on the "corrupt" library - still facing the problem.
    - Created a new library and copied all content from the "corrupt" library into it. Also facing the issue.
    Now I found out how to reproduce the problem:
    1. Create a document library and create the folder "Testfolder" in it.
    2. Create another three folders in "Testfolder".
    3. Upload a document (f. e. test.txt) into one of the three folders.
    4. Change the number of viewable documents per page in the view settings to 2. (to activate the paging)
    5. Now open "Testfolder" and switch the pages (2 or 3 times). Now you see test.txt directly in "Testfolder" together with the other 3 folders.
    What do you think?

  • Creating a folder for a document library in SharePoint online

    Hello I am looking for a good place to get started on creating a folder for a document library using a powershell script. Thanks in advance for any help.

    Here is a guide to creating folders and items in a document library for SharePoint Server/Foundation: Creating SharePoint Folders
    and Items with PowerShell. You will need to tailor it to your needs as it's a demo for creating 50,000 items.
    That's step 1 and contains the bulk of what you would need to do. Here's an example of connecting to a library in SharePoint Online using CSOM: Office
    365 - PowerShell Script to Upload Files to a Document Library using CSOM. You won't be uploading files, but the parts where you connect and get a list are what you're interested in.
    Now you'll combine bits from both of these scripts:
    1. Connect to SPO
    2. Get your list (looks like you need to first get the site collection and then the site)
    3. Create a folder
    I figure it would look something like this (note I haven't tested this at all):
    #Specify tenant admin and site URL
    $User = "[email protected]"
    $SiteURL = "https://tenant.sharepoint.com/sites/site"
    $DocLibName = "DocLib"$FolderTitle = "Example Folder"
    #Add references to SharePoint client assemblies and authenticate to Office 365 site - required for CSOM
    Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
    Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
    $Password = Read-Host -Prompt "Please enter your password" -AsSecureString
    #Bind to site collection
    $Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
    $Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User,$Password)
    $Context.Credentials = $Creds
    #Retrieve list
    $List = $Context.Web.Lists.GetByTitle($DocLibName)
    $folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder)
    $folder["Title"] = $FolderTitle
    $folder.Update();
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • Document library in Explorer showing empty folder and edit in microsoft word not is also not working

    Hello
    I am facing strange issue. I have two different SP2010 environment on two different servers i.e. dev1 and dev2 and each envionment we have one web application i.e.
    http://dev1/ and http://dev2/
    I am testing this environment from my desktop which has Windows 7, IE8, Office 2010.
    I tested Dev1 url on my desktop, and able to open document library using windows explorer, I am able to see files and folders. I am also able to use "Edit in Microsoft Word" is options is working on my desktop. Infact tested on other machine, it
    is working fine.
    Then I tested Dev2 url, I am able to open dcument library using windows explorer on my desktop, but it is not showing any files and folders and when I tried to to use "Edit in Microsoft Word" got the error "The document could
    not be opened for editing. A Microsoft SharePoint Foundation compatible application could not be found to edit the document". When I test dev2 url on other machine it is working without any problem. However I am able to upload and download from the document
    library.
    I googled a lot but could not findout a perfect solution, Please let me guide what I am missing here.
    Avian

    Hi Avian,
    Which suggestions did you do for resoving this issue?
    Below are some troubeshotting for you:
    Make sure your IE 8 is 32-bit
    Add the URL of dev2 to Trusted Site
    Make sure that SharePoint OpenDocumentsClass and SharePoint OpenXMLDocuments are enabled as IE Options->Programs->Manage add-ons
    Repaire Office 2010 under Control Panel
    Here is a similar post, in the reply section, there are some suggestions, please take a look at:
    http://social.technet.microsoft.com/Forums/projectserver/en-US/3e8c0976-2794-49a2-92fe-6a254b3cc4ca/a-microsoft-sharepoint-foundation-compatible-application-could-not-be-found?forum=projserv2010setup
    Also check whether this link is useful:
    http://support.microsoft.com/kb/2823322/en-us
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Issue with New Document in a document library with multiple content types

    Hi,
    I have a created a custom list definition based on a document library. I added 3 content types in this list, one is a document set (lets call it DOCSET), the two others are content types inheriting from Document (DOCA and DOCB).
    I deployed the list definition with a site scoped feature and the list instance with a web scoped feature. After activating the two features, the list is created and the content types are present in the list.
    When I click in the New Document button and choose either the DOCA or DOCB content type, a Word document opens and the DOCA content type is always associated to this Word document.
    With SharePoint Manager 2013 I saw that the template.dotx document was not in the Forms/DOCA or Forms/DOCB folder.
    So I decided to remove all the content types from the list definition and add them by code with the ListAdded event receiver. I used list.ContentTypes.Add to add the content types to the list.
    With this method the templates are correctly copied from the template.dotx in the RootFolder/Forms folder of my list. These templates have the rights content type id, but the New Document button still does not work properly.
    So I looked at the Content Types inside my library and saw that the DocumentTemplateUrl linked to the RootFolder/Forms/template.dotx and not the RootFolder/Forms/DOCA/template.dotx or RootFolder/Forms/DOCB/template.dotx.
    I debugged my code to look closer and see that right after the list.ContentTypes.Add, the DocumentTemplateUrl is correclty set but when my EventReceiver finishes, the DocumentTemplateUrl get back to the RootFolder/Forms/template.dotx.
    Have you any idea why this is not working ?
    Regards

    Hi,
    Per my understanding, there is an issue about the DOCA and DOCB content types which inherits from Document Content Type in your custom list definition.
    By default, if there is a custom content type inherits the OOTB Document Content Type, it will also inherits the template.dotx file from the OOTB Document Content Type.
    The template URL of a custom content type which inherits the OOTB Document Content Type:
    If you want to specify different templates for different content types, the code demo below would be helpful:
    http://www.learningsharepoint.com/2010/07/14/programmatically-create-a-new-content-type-in-sharepoint-2010/
    Thanks
    Patrick Liang
    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]

  • Some chinese character file name not uploading in SharePoint Document Library?

    Hi
    Some Chinese character pdf file name not uploading in SharePoint Document Library. I am getting following error.
    1. File not found error if i would upload using file browse option in Doc Lib.
    2. Can't read from the source file or disk. if i would tried to copy and paste using "Open with explorer" options.
    File name is "LA(未签署).pdf"
    Note: This file has been converted from "TIFF" to "PDF".
    Thanks & Regards
    Poomani Sankaran

    Hi Poomani,
    For troubleshooting your issue, please let's verify the followings:
    Whether other pdf file which are not converted from "TIFF" and contain Chinese char could be uploaded into the SharePoint Document library.
    Whether other pdf file which are converted from "TIFF" and don't contain Chinese char could be uploaded into the SharePoint Document library.
    Please upload these pdf files into other libraries, compare the result.
    Please check the log file to find more information about this issue. The path of the log file is:
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS.
    Best Regards,
    Wendy
    Wendy Li
    TechNet Community Support

  • Workflow in document library doesn't function properly on uploaded documents

    I have a document library with a few different content types. When documents are added to the library either via new or upload I want to run a workflow that numbers the documents (so contracts have a contract number & change orders have an order number).
    The counters are in a separate list - one item for each counter, a last number and a calculated next number.
    So for contract numbers the workflow gets the nextnumber for the counter and enters it into the contract number field of the current item before sending it back to the counter as last number. 
    The workflow is set to start on item creation and works just fine with new documents. However, it doesn't work on uploaded documents. In order to discern between the different content types I've set a field condition to recognize if the workflow should run.
    When uploading documents the workflow runs before the field is set and therefore doesn't set the contract number. 
    I tried just setting a 5 min "wait" at the start of the workflow, but then the document fails to save. 
    Workflow:
    Sorry it's in Norwegian, I can't figure out how to get the conditions and actions into English (all my buttons etc are in English)...
    Any ideas on how to get the workflow to run properly in order to update the contract number?

    Hi,
    According to your post, my understanding is that you had a workflow in document library didn’t work properly.
    I hadcreated a list called Counter1, created a library called
    New&Upload, modified the view of the list, made it display the
    ID of the list.
    I created a simple workflow as below, selected “Start workflow automatically when an item is created”, it worked well without any issue no matter
    Upload or New a document.
    You can create a new workflow with a new library, then check whether it works.
    You can also check the event log and ULS log to see if anything unexpected occurred.
    To check event log, click the Start button and type “Event Viewer” in the Search box.
    For SharePoint 2013, by default, ULS log is at      
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS
    You can check the ULS log by the methods here:
    http://blogs.msdn.com/b/opal/archive/2009/12/22/uls-viewer-for-sharepoint-2010-troubleshooting.aspx
    http://msdn.microsoft.com/en-us/library/gg193966(v=office.14).aspx
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

Maybe you are looking for