Got it, I'll try that.
Regards,
Got it, I'll try that.
Regards,
How do I query the file names for a specific user? I will create a list, and have the userid populate in a label, and then query files for that specific user id. Should I add a where? What should the return code be?
Hi Mike,
Unfortunatly "where" filter is not available for system Files collection..
You have two ways to solve this issue:
Create server script that will get all files and filter them by Owner.
Create user_files collection(fileName: string, user: pointer_to_users). With this collection - you can link all files with user you need. Then you can access/edit/filter this collection like you need(for example - get all files by current user).
Regards.
Hi,
For testing purposes, I created fileName: string, and user: and pointed user to users. I manually enter the user id as show in this screenshot:
I then mapped filename to to files label so when I use the listing there, I can see the file names for certain users:
However, when I run the list service, I see undefined in the files label:
Is there a reason why?
Regards,
Hi Mike,
It seems you have wrong service response parameters.
You should have "file_name" string response parameter. Currently i see only "Files" which is an object.
Also please show us your full mapping screen shot(not cropped). In you one - i can not see details.
Regards.
I think it has to be done in the upload service. I managed to show the file name. I referred to this solution: https://getsatisfaction.com/apperyio/...
So far, I'm making progress. I'm able to display the file using this command:
console.log(data);
alert(data[0].success.filename);.
However, only one file is being displayed. My intention is store store the multiple files names in an array. I need to list them later on when I use the listing service.
Here's what I need to do, and what I need assistance with:
I managed to create the upload service. I managed to display the file name after the file is uploaded. I need to store the filenames uploaded into a local storage variable so when I use the create service after the files get uploaded, the file names go into the applications collection along with the user details/property types... What code should I use to do that?
Regards,
Hi Mike,
It seems you have several wrongs in implementation.
Common plan to do it:
Upload file, and store "fileName" to LSV(please check whether you have correct filename in this LSV).
Modificate your list/create service. This services should have "file_name" string-type parameter. Currently you have "files" that's an object. Also you can just delete these services and import from DB them again.
In create service (for collection where you added "file_name" field) datasource mapping find "file_name" request parameter and click on "JS". Then populate it with following code:
pre
//where "db_file_name" is LSV name where you store file name from 1st step.
return localStorage.getItem('db_file_name');
/pre
Regards.
How do I store fileName to LSV. I tried mapping filename on success to db_file_name. It didn't work.
Hi Mike,
You can use simple local storage or Appery.io storage
1) localStorage.setItem("file_name", "myfile.jpg");
2) Apperyio.storage.file.set("myfile.jpg"); // don't forget to create a variable in Modal and Storage of App project
http://devcenter.appery.io/documentat...