Created
December 17, 2024 09:15
-
-
Save shohag-cse-knu/78e475f7edd2f46dea64a1c8aaab14b1 to your computer and use it in GitHub Desktop.
File is tempered or not in the server storage can be checked compared to the uploading time and file modification time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$Msg = ""; | |
$row = $this->db->query("SELECT folder_name, file_name, uploaded_time FROM documents")->row(); | |
$folder_name = $row->folder_name; | |
$filename = $row->file_name; | |
$uploaded_time = $row->uploaded_time; | |
$file_path = getcwd().DIRECTORY_SEPARATOR.$folder_name.'/'.$filename; | |
if (file_exists($file_path)) { | |
$file_modification_time = date("Y-m-d H:i:s", filemtime("$file_path")); | |
if(strtotime($file_modification_time) != strtotime($uploaded_time)) | |
$Msg = "FIle Tempered"; | |
else | |
$Msg = "File Missing"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment