how do i get the folders, with related subfolders and files of a document library in spfx? - sharepoint

At the moment I can recover all items without distinction but I would need to recall in this order: folders or files of a document library and then the relative subfolders and files of the main folder.
I would need to recall in this order: folders or files of a document library and then the related subfolders and files of the parent folder.

Related

Transfer files under multiple folder from sftp to sharepoint document library using logic app

I have a scenario how to transfer files from sftp server to sharepoint document library
Example: files in sftp folder are /new/folder1/id1.csv /new/folder2/id2.csv like that every day the files will be uploaded to folders. how to transfer the same structure in sharepoint document library using logic apps..
The workflow for your folder structure would be as follows:
List files in your SFTP folder "/new".
Create a "For each" loop using the output of the list action as a parameter.
To make sure you don't treat files as folders (if you can have files in /new, e.g. /new/test.txt), add a condition: the IsFolder property of the loop item = true.
Inside the loop (and the condition result True) list files again, this time in the subfolder, using the Path property of the loop item.
Create a new "For each" loop using the output of this list action as a parameter.
Optionally, add a condition: the IsFolder property of the inner loop item = false.
Get content of the SFTP file, using the Id property of the inner loop item.
Create a file on SharePoint using the folder path, file name, and file content retrieved in the previous actions as parameters. If the folder doesn't exist in SharePoint library, it should be created automatically.
This is the most simple scenario, given the folder structure provided in your question. If the folder structure is more complex (subfolders can contain both files and subfolders, which in turn can contain other files and subfolders, and so on) then you'd need to use a recursive algorithm - first the Logic App would need to list files in a single SFTP folder (provided to the Logic App in the HTTP request body), then for each listed file (not subfolder) upload its content to SharePoint, and for each listed subfolder (not file) the Logic App would need to call itself passing the subfolder path in the HTTP request body - this way all subfolders would be processed recursively and all files in them would be transferred to SharePoint.
Please note that each such a workflow is run it would transfer all files - it wouldn't check what files are new, what files have been transferred in previous Logic App runs, etc. - that would be a completely different challenge.

Store a folder into a single file without using external library or database

I want to archive and unarchive a whole folder into/from a file. It's similar to compress/uncompress a folder as a zip file. The original folder structure should be preserved.
Here're what I'm trying to do:
- Archive a whole folder into a single archive file.
- Unarchive an archive file to a target folder (i.e extract the file onto another folder)
- Update a file (file content or file name) in the archive file without having to recreate the whole
archive from scratch.
- Delete one or many files or folders (and file within them) from the archive.
It would be much easier if I use external libraries or database for storage. But I need to do those tasks without using any library/tool. Please give me suggestion.

Populate all the folders in a document library

I want to populate all the folders in document library to a drop down. I was thinking of using spquery for it but not sure how to retrieve all the folders with it.
You shoudl use the root folder of the lib and from that folder iterate through its Folders collection. Note that you need to set web.Lists.IncludeRootFolder to true to get access to the root folder.
But something I don't understand - folders have a tree-like structure, how do you intend to put them into a flat ddl?

List folders and subfolders from a directory in Excel with hyperlinks?

I am looking for a vb script that would list the folders and subfolders from a directory, and output it to excel so that i could open the folders via hyperlinks.
I am trying to create a sort of directory index that collates about 100 parent folders from 2 directories located on 2 different servers. Some parent folders have up to 20 subfolders and then a further 5 folders in each subfolder.
Ideally the layout would be like this.
Parent Folder Subdirectory
Folder1 Sub1 Folder
Folder
Sub2 Folder
Folder
Sub3 Folder
Folder
Folder2 Sub1 Folder
etc etc.
I have no knowledge of visual basic programming, so if anyone could help you would save me a great deal of time from creating this index manually.
Thanks
Chris
Take a look here: HOW TO: Recursively Search Directories by Using FileSystemObject

In a sharepoint .wsp file how do I move a folder full of files into the sharepoint filesystem

I need to move a folder of files (+-100 or so) from within a .wsp file
Steps
1) Package up files into the wsp
2) When Feature is activated copy files to the filesystem (12\LAYOUTS\MyPackage)
3) When Feature removed delete the MyPackage folder
4) .......
5) Profit
The files do not need to be versioned etc by SharePoint.
You'll need to use the module element within the elements.XML file referenced by your feature definition; details here:
http://msdn.microsoft.com/en-us/library/ms441170.aspx
The module element is correct. To remove the files when you are done, use the code from my post which will delete any file that was created with the module element.

Resources