In my application (it's similar to a social media app) , there are several areas where a user can upload a media file. Mostly pic and video files. For example, a user has there own "homegroup" where they can post topics and attach media files to the post. So I have a post and post attachment table. In the post attachment table I am planning to have a field, uploaded_media_ref, that contain a unique id or filepath to the location of the file where it was uploaded to the server. Does the application need to generate a unique file "ID" which must be the name of the file which matches the field contents of uploaded_media_ref?
What is the best way to accomplish this type of functionality? I've looked and I can't seem to find many examples out there , but I would think this is a common thing. Just trying to not invent the wheel...