K
K
koljaka5282021-09-27 22:10:12
Django
koljaka528, 2021-09-27 22:10:12

How to check the relevance of the uploaded file and the file on the server in Django Python?

The essence of the problem is that when a file is uploaded to the server, its modification, creation, and opening date and time change to the current ones. Let me explain with an example why I need a file modification date.
There is a pdf file on the local computer, through the form on the site (implemented on Django) I want to upload this file to the cloud on Yandex.Disk (Y.D), while the file metadata (name, size, modification date, etc.) write to the database. After a while, I get another version of this file and I need to compare the file modification date on J.D and the new file. If the old version is on Y.D, I move it to the archive, and uploading the new version to Y.D with the “current” flag.
After two weeks of searching, I begin to understand that, due to security reasons, reading files on the client is very limited and what I am trying to do "on the forehead" is most likely impossible. Maybe someone came across, I will be glad for any information.
The security of uploading files does not matter, because I will upload the files myself. Possible file types are pdf, doc, docx, xls, xlsx, dwg.
I am already leaning towards a workaround to make a utility that will generate a package of files with the necessary information about them on the local computer, upload this package to Ya.D, and from Ya.D upload data to the site and to the database.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question