Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7179047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:03:39+00:00 2026-05-28T17:03:39+00:00

I’m stuck, help me out !!! I have got a FILE table with: file_id

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:03:40+00:00Added an answer on May 28, 2026 at 5:03 pm

    First, some notes about your question:

    MAC ADDRESS is probably irrelevant, unless you are serving files to your local network. Otherwise it will be meaningless.

    IP ADDRESS: you should also consider that if your users are behind a proxy they’ll be accessing your server with the same IP origin, in which case they shouldn’t be blocked.


    Answer:

    In my opinion the best solution would be to authenticate your users, either with a local account or with openid/googleid/others and then use store the user id on your FILE_DOWNLOAD_COUNT table.

    If using accounts is not an option, I’m afraid you’ll have to manage both cases (IP’s and COOKIES) and expect that the number of users that will circumvent both checks will be relatively small.

    Also don’t forget to add some sort of captcha to prevent automated downloads.

    This link may be of interest as well, you could attempt to decipher if the user broswer has visited the “download a specific file” before by the fact that it’ll ask the webserver if there is new content or if the page being served is up-to-date. And use this value to create some sort of additional check mechanism (or to increase/decrease the weight of your other mechanisms).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
i want to parse a xhtml file and display in UITableView. what is the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an XML file, the creators of it stuck in a bunch social
I have a reasonable size flat file database of text documents mostly saved in
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.