Hi All,
Apart of my website requires me to collect files from specific members for me to assess and in turn, return documented feedback (through video and PDF) to that member without any other member seeing it for privacy reasons.
I have been able to collect documents from specific users by creating a form and a custom members page but am now stuck on sharing specific files back to specific members and having these files listed and available to download.
If those items that the user has uploaded has their userID linked to their items that they have uploaded, then you can simply have a repeater or a table that shows the users upload and as those uploads have the specific members userID attached to them, then it should be only that member who can see the uploads.
Thanks for the response. I have watched the video and I am not quite seeing the connection yet. I am still very much a beginner and so this is quite a number of steps ahead of my knowledge.
I guess my questions should be more along the lines of:
How do I upload my own files (the feedback) to the website / database?
How do I isolate those files to one member?
How will I be able to display these files to that one member?
Hi GOS - unfortunately I do not believe we are on the same page on what I am seeking. As it appears to me - you are talking about logged in members viewing files uploaded by themselves, however this is not what I am in need of.
I wish for myself as the Owner to upload my own files (the feedback of the member submissions) and have only the member the feedback relates to, to see the file. No other member can see it. Just like a teacher would when returning feedback for a student assignment.
All you have to do is create an administration page and add a form with 2 entries:
1- to insert the file. (Upload button)
2- to add the name of the person who should receive the file or their email. (Text input)
And connect it with a collection
Then, in the profile page or a normal page, add a download button, connect it to the same collection (to download the file that you uploaded before), but you will need to add a filter to download only the file with the name or email of the current user.
Hi Oussama. Thanks for the response. If you could provide me with an example I would be very grateful. As you probably have noticed via this thread I am fairly hopeless at this. Thanks.
This is the full code (This code filtre the dataset to show only the files with the email equal to the curent user’s email):
import wixUsers from 'wix-users';
import wixData from 'wix-data';
$w.onReady(function () {
let user = wixUsers.currentUser;
let userEmail;
user.getEmail().then( (email) => {userEmail = email;
$w("#dataset1").onReady(() => {
$w("#dataset1").setFilter(wixData.filter()
.eq("email", userEmail)
)
})
} );
});
And boom, your pages are ready, when you upload a file in the Admin page, the user who has logged in with the same e-mail you entered will see and can download the file in the client page.
Hello @oussamaismaili7 this works great but I need to add something to this code: I’d like to be able to see both the mails that are sent to my mail, but also the ones that I upload. How should I change the code?
Hi,
that might be because your database is set to Admin-only. You can change the settings to ‘custom use’. Then you need to set the custom settings that fits your needs.
That could solve the problem.
How can we add in the code to hide the uploads if there is no user logged in? Currently, if there is no user signed in, it will show the uploads of everything. Aside from this, the code is exactly what I was looking for!
You’re the man!! Thank you very much for this!
There’s just one little issue happening, when a member access his private area to check for the files I sent him it shows all the files the i’ve sent to all members until the page loads completely, then it hides other people files.
Do you know what might be happening?