I'm stuck, help me out !!!
I have got a FILE table with: file_id BIGINT,file_name VARCHAR,file BLOB... etc
I want to count the no of downloads of each file per user/computer so that i can identify the total count of each file and also want to avoid a situation where a single user is downloading the files multiple times,
I just want to know the best way in which it can be implemented, up till now i have thought of following ways:
1) Create a table FILE_DOWNLOAD_COUNT (FILE_ID,UNIQUE_ID) 2) whenever the file is downloaded insert a new record into this table with the ID of the file downloaded and a UNIQUE value corresponding to every download request.
But , what should be used to identfy the UNIQUE_ID???
IP ADDRESS/MAC ADDRESS/A COOKIE Value
ISSUES :
IP ADDRESS : At every new connection, a new IP address is assigned (DYNAMIC IP)
MAC ADDRESS: can be changed and MAC spoofing can be used
A COOKIE Value: can be deleted.
So just help me how can i achive this with most reliable way.
FYI: I'm implementing it in
JAVA (STRUTS2+Spring) + MYSQL
Thanks in advance