Helsen
Posts: 0
Joined: Wed Jul 31, 2013 1:42 pm

How to retrieving "File names" for all files (from dabase service API) from specific owner?

Hello Appery.io Team!

my app already can Upload and Retrieving files from DB (File API),
but I can't find a solution how to Retrieving ALL fileNames for specifc user(owner) in DB (Files Built-in collection).

Can you help me?

Regards

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to retrieving "File names" for all files (from dabase service API) from specific owner?

Take a look at $in in where clause please.
You can send request to DB and set in "where" something like this:
code{"user_id": {"$in": ["fileName"]}}/code

Helsen
Posts: 0
Joined: Wed Jul 31, 2013 1:42 pm

How to retrieving "File names" for all files (from dabase service API) from specific owner?

Thank you for reply, but I can't access files stored in database in this way (this is my fault?), in appery.io docs (Database - File Api) tell me to retrieve file with file name only.

----doc-----
Retrieving Files

curl -X GET
-H "Content-Type: [set_to_file_type]"
-H "X-Appery-Database-Id: 498ad4r0e4b9348a121cf6ea"
-H "X-Appery-Session-Token: 900ad7b0e4b9808a456cf5ba"
]https://api.appery.io/rest/1/db/files...

----end doc-----

In my case, I need retrieve a list of files, I don't know the name, I want retrieve all files.

Can I use all OBJECT API to access Files stored in Database? Any sample?

Thanks again

Helsen
Posts: 0
Joined: Wed Jul 31, 2013 1:42 pm

How to retrieving "File names" for all files (from dabase service API) from specific owner?

I've tried,and give up.
I cant query https://api.appery.io/rest/1/db/files
Without file name, but when I don't know name Files, what can I do?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

How to retrieving "File names" for all files (from dabase service API) from specific owner?

Helo Helsen! Sorry for late respond. We'll check and let you know.

Helsen
Posts: 0
Joined: Wed Jul 31, 2013 1:42 pm

How to retrieving "File names" for all files (from dabase service API) from specific owner?

As I said, I use Files (built-in collection - like users built-in collection) it's not customized collection.

Result:

Code: Select all

codeDBSQ203/code 
Collection 'files' absent in database with id 'xxxxxxxxxxxxxxxx'.
Helsen
Posts: 0
Joined: Wed Jul 31, 2013 1:42 pm

How to retrieving "File names" for all files (from dabase service API) from specific owner?

I need to create a workaround because not have solution for my question.

1- create a collection files_custom (for add to default File Built-in collection)
2- create column file_url
3- create column file_name
4- upload file with File API (database) http://docs.appery.io/documentation/b...
5- get result file url and file name to local storage
6- insert data in collection files_custom
7- now I can make query to get all files urls and filenames

but is very poor method to do simple thing....

Return to “Issues”