Similar to using Baidu Library, downloading a file requires one download coupon. When Downloading this file for the first time, one download coupon will be deducted, when this account downloads this file again, the download coupon will not be deducted. I want to have a download_records table, which is used with the users table... similar to using Baidu Library, downloading a file requires one download coupon. When Downloading this file for the first time, one download coupon will be deducted, when this account downloads this file again, the download coupon will not be deducted.
I want to have a download_records table, which is associated with the users table one to multiple. Every time a file is downloaded, a record is written to the download_records table, as shown in the following figure:
id download_record user_id1 ... 1232 ... 123
So what is the record for this download_record field? Is it the path + file name of this file? Or something else?
Reply content:
Similar to using Baidu Library, downloading a file requires one download coupon. When Downloading this file for the first time, one download coupon will be deducted, when this account downloads this file again, the download coupon will not be deducted.
I want to have a download_records table, which is associated with the users table one to multiple. Every time a file is downloaded, a record is written to the download_records table, as shown in the following figure:
id download_record user_id1 ... 1232 ... 123
So what is the record for this download_record field? Is it the path + file name of this file? Or something else?
You have created an association table between your account and the downloaded file.
Ideas:
Direct download is not supported, that is, no resolution is provided during the download. Prohibit download from the server address/av. avi. Change to xxx. php? Filename = av. avi to parse and download. Then write the business logic in xxx. php.
You can record your file ID. If your file has multiple types and stores multiple locations, you can repeat this ID and add another type record file type.
File type and ID plus unique restrictions
Subject: Is the downloaded resource uploaded in the background? The background upload should have an ID. You can record the resource ID, user ID, and download time in the resource download table =. Others will be determined based on project requirements.
Record File id
id article_id user_id down_num
When downloading, you can determine whether the user has downloaded the file. If you have downloaded the file, no credits are deducted. down_num indicates the number of downloads. If you have not downloaded the file, you do not need to add a record.
I suggest creatingFile TableAndUser table.
Creating a table only records the file id and user id.
If you want to download expired after a certain period of time, you can add a timestamp field