Giving files from a remote server a specific id

Viewed 47

I am working on a subscription page. On this page, user A can subscribe to their favorite albums. If user B uploads an album, then user A will be able to download that new album. However, he can only download those albums to which he has subscribed. Other albums should not be visible. We show a list of albums that have been uploaded, they can download it once they subscribe

To achieve this, I was thinking about giving each new album an automatic id once they are uploaded. However, I do not know if this is possible since the albums are coming from a remote FTP server. It would also be impossible because I would have to write an if statement for every id:

if($id == 1) {
  //do display;
} else {
  // do not display;
}

And I, of course, I do not want to do that.

My question: How can I make sure that user A can only see those files that he has subscribed to? How can I do this since the files come from a remote FTP server (I can already retrieve them)?

PS. I have not written code yet, I am thinking about how I can accomplish this.

0 Answers
Related