B
B
Boris Belov2019-03-20 11:51:50
PDF
Boris Belov, 2019-03-20 11:51:50

How to insert user ID into file properties?

We make a site on WP
The client needs to implement such a thing so that after downloading the file by the buyer, the user ID is displayed in the file properties, this is necessary so that these files do not spread over the Internet, and if someone downloads them, it will be clear by the ID - who.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pychev Anatoly, 2019-03-20
@iborisbelov

So what's the problem.
Take a module that generates your file type, or one that can read and save your file type, and store meta information.
As a last resort, you can even convert your meta-information to a set of non-displayable characters and write it somewhere at the end of the whole text. And to check, use the reverse conversion
. Text fields, as additional properties, are visible in editors, but some line of 100 invisible characters at the end of the entire text is not immediately evident.
It all depends on the file type. If this is excel, then there is generally a zip archive, shove whatever you want.

R
Rsa97, 2019-03-20
@Rsa97

The buyer can safely clean any additional fields.
IMHO, the only more or less working option is watermarks in the text. But they can also be circumvented by taking a few sold copies.
You can watch, but you can not download - it's a fiction. Any text displayed on the screen can, at least, be recognized from screenshots, and often it is easy to figure out the algorithms for getting it from the server and displaying it.

F
FanatPHP, 2019-03-20
@FanatPHP

About the text file are fairy tales.
There are two things to be understood here.
First: what is a file.
The concept of a file only makes sense in a file system. And although a file in the file system may have attributes that, with a certain amount of ingenuity, can be used for various purposes not intended for this, but when transferred via the HTTP protocol, the file ceases to be a file , but turns into a stream of bytes. As a result, all attributes remain on the server, and a new file is created on the client, into which this stream is written. In this case, all attributes are formed on the client, and nothing can be written there.
Second. Text format.
Of course, many file formats have the ability to store meta-information. These are pictures, office files, pdf and so on.
In text files, in the conventional sense, there is simply nowhere to store meta-information. So we can't talk about text files.
If we are talking about other formats, then you just need to read the specification for a specific format and see what fields for meta-data are there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question