Fetching files list from folder

cancel
Showing results for 
Search instead for 
Did you mean: 
aishu
Active Member

Fetching files list from folder

Dear Team,

I need to get list of files information of one folder by using folder name from site.

Could you please help on this!

 

 

Kind & Regards,

Aishwarya Jadhav.

3 Replies
aishu
Active Member

Re: Fetching files list from folder

++ adding one point.

 

I need api for this

sanjaybandhniya
Intermediate

Re: Fetching files list from folder

You can use REST API for search.

https://api-explorer.alfresco.com/api-explorer/#/search

 

URL : http://localhost:8080/alfresco/api/-default-/public/search/versions/1/search (post method)

Body : 

{
"query": {
"query": "PATH:\"/app:company_home/st:sites/cm:swsdp/cm:documentLibrary/cm:test//*\"",
"language": "afts"
}
}

 

Here swsdp is site-name and test  is folder name.

EddieMay
Alfresco Employee

Re: Fetching files list from folder

Hi @aishu 

@sanjaybandhniya beat me to it! You can also use Lucene search query in a very similar way.

http://localhost/alfresco/api/-default-/public/search/versions/1/search

The query body is as follows:

 

{
"query": {
"query": "PATH:\"/app:company_home/st:sites/cm:publicSiteAPI/cm:documentLibrary/cm:Uploads//*\" AND (TYPE:\"cm:content\" OR TYPE:\"cm:folder\")",
"language": "lucene"
},
"include": ["properties"]
}

This limits the query to all files or folders under the Uploads folder of the publicSiteAPI site.

Kudos to @gtarafder for posting this solution here.

Cheers,

 

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!