Page 1 of 2

'List Service' functionality for uploaded files to DB?

Posted: Sun Aug 31, 2014 5:04 am
by Jake Hare7049642

I followed the instructions for letting users upload files to the appery DB. Now I want the user to see a list of the 'original file name' of the files they uploaded, and also give them the ability to delete those files (similar to the to-do app).

Is there an easy way to do this? I only see the 'Read Service' available for the files DB.

Thanks!


'List Service' functionality for uploaded files to DB?

Posted: Sun Aug 31, 2014 6:09 am
by Illya Stepanov

Hi Jake,

Please check our File API section in our docs for achieving this:
:: http://devcenter.appery.io/documentat...
:: http://devcenter.appery.io/documentat...


'List Service' functionality for uploaded files to DB?

Posted: Sun Aug 31, 2014 2:15 pm
by Jake Hare7049642

Thanks! I'll try it and let you know.


'List Service' functionality for uploaded files to DB?

Posted: Sun Aug 31, 2014 4:07 pm
by Jake Hare7049642

I tried the listing, but it didn't work. See these screenshots for a more thorough explanation. I want only the user who uploaded the file to see it in the list.

Image Image Image


'List Service' functionality for uploaded files to DB?

Posted: Mon Sep 01, 2014 1:21 am
by Jake Hare7049642

I tried with a session token as well and get the same error


'List Service' functionality for uploaded files to DB?

Posted: Mon Sep 01, 2014 3:09 am
by Yurii Orishchuk

Hi Jake,

I see a culprit of your problem(you have passed wrong session token parameter): http://prntscr.com/4iirbr/direct

Also i've checked this service and it works perfectly.

Here is my screen shots, check out them:

1 settings tab: http://prntscr.com/4iirjz/direct

2 request tab: http://prntscr.com/4iirnh/direct

3 test tab: http://prntscr.com/4iirra/direct

Regards.


'List Service' functionality for uploaded files to DB?

Posted: Mon Sep 01, 2014 4:40 am
by Jake Hare7049642

Hi Yurii,

I'm not sure how yours worked; I see two strange things with yours:

  1. In your request tab, you show {database_id} in the session token field, and a random number which I assume is some other database id in that field.

  2. In the test tab, what number is it that you're using as the session token? I thought the session token was the same as a user's _id.

    Thanks,

    Jake


'List Service' functionality for uploaded files to DB?

Posted: Mon Sep 01, 2014 4:46 am
by Jake Hare7049642

'List Service' functionality for uploaded files to DB?

Posted: Mon Sep 01, 2014 4:47 am
by Jake Hare7049642

Here's the request tab with the test above:
Image


'List Service' functionality for uploaded files to DB?

Posted: Mon Sep 01, 2014 5:03 am
by Jake Hare7049642

I figured it out; the problem was I did not know the difference between the user _id and the session token. Once I figured that out I used the 'login service' to find a valid session token to test, and now it works fine.

Thanks!!!