Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
Prog
/
File explorer
:
envoi_multiples07.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php // Count total files $countfiles = count($_FILES['files']['name']); // Upload Location $upload_location = "Doc_uploads/"; $upload_location = "http://analog-design.net/Administratif/CAF/"; //$upload_location = "/home/analogde/www/Administratif/CAF/"; //$upload_location = "/home/analogde/www/Administratif/CAF/"; // si $_COOKIE["cookie_upload"] est vide, il faut éviter : /home/analogde/www//"; $upload_location = "/home/analogde/www/" .$_COOKIE["cookie_upload"] ."/"; $upload_location = "/home/analogde/www/Administratif/CAF/"; //// <?php echo fm_enc(FM_PATH) // To store uploaded files path $files_arr = array(); $uploaded_files_str = ''; // Loop all files for($index = 0;$index < $countfiles;$index++) { if(isset($_FILES['files']['name'][$index]) && $_FILES['files']['name'][$index] != '') { // File name $filename = $_FILES['files']['name'][$index]; // Get extension //$ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); // Valid image extension //$valid_ext = array("png","jpeg","jpg"); // Check extension //if(in_array($ext, $valid_ext)) //{ // File path $path = $upload_location.$filename; // le fichier existe ? //if (file_exists($my_folder . $_FILES['file']['name'])) if (file_exists($path)) { $pos = strrpos($filename,'.'); $ext = substr($filename,$pos); $file_basename = substr($filename, 0, strripos($filename, '.')); $datetime = date("d-m-Y H:i:s"); $datetime = $datetime . "zzzz"; $path = $upload_location .$file_basename ."_changed_" .$ext; $path = $upload_location .$file_basename ."_" .$datetime ."_" .$ext; //$path = $upload_location.$filename."_changed"; $array = []; for ($x = 0; $x <= 1000; $x++) { $array[] = "***rev_" .$x ."***"; } // https://github.com/viquaruddinahmed/Document_Management_System/tree/master/includes // https://github.com/opendocman/opendocman // Free PHP Document Management System DMS // Upload files using web browser // Control access to files based on department or individual user permissions //* Track revisions of documents //* Option to send new and updated files through review process //* Installs on most web servers with PHP //* Set up a reviewal process for all new files //55555 $str = getBetween($filename, $start = "***", $end = "***"); } // Upload file if(move_uploaded_file($_FILES['files']['tmp_name'][$index], $path)) { $infos = filemtime($path); $text = "Last modified " . date("l, dS F, Y, h:ia", $infos) . "\n"; $handle = fopen("data.txt", "w"); fwrite($handle, $text); fclose($handle); $filename = $_FILES['files']['name'][$index]; $filesize = $_FILES['files']['size'][$index]; $filetype = $_FILES['files']['type'][$index]; $val = $val + " *** " .$_FILES['files']['full_path'][$index]; ///aaa($filename, $filesize, $filetype); // basename($_FILES["file"]["name"] //filemtime($_FILES['fileToUpload']["tmp_name"]) // filemtime($_FILES['files']['name']) $files_arr[] = $path; //$files_arr[] = $path + " Succés "; } /*else { $files_arr[] = $path + " Erreur "; }*/ } } // echo json_encode($files_arr); die; function aaa($filename, $filesize, $filetype) { $db_host = "analogdepat.mysql.db"; $db_user = "analogdepat"; $db_pass = "Un92pac007"; $db_name = "analogdepat"; $conn = new mysqli($db_host, $db_user, $db_pass, $db_name); /*if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); }*/ // Insert the file information into the database $sql = "INSERT INTO files (filename, filesize, filetype) VALUES ('$filename', '$filesize', '$filetype')"; $conn->query($sql); $conn->close(); } function getBetween($string, $start = "", $end = "") { if (strpos($string, $start)) { $startCharCount = strpos($string, $start) + strlen($start); $firstSubStr = substr($string, $startCharCount, strlen($string)); $endCharCount = strpos($firstSubStr, $end); if ($endCharCount == 0) { $endCharCount = strlen($firstSubStr); } return substr($firstSubStr, 0, $endCharCount); } else { return ''; } } /* $isValidFile = true; // Validate if file already exists if (file_exists($fileName)) { echo "<span>File already exists.</span>"; $isValidFile = false; } */ /* <?php $target_dir = "uploads/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION)); // Check if image file is a actual image or fake image if(isset($_POST["submit"])) { $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]); if($check !== false) { echo "File is an image - " . $check["mime"] . "."; $uploadOk = 1; } else { echo "File is not an image."; $uploadOk = 0; } } // Check if file already exists if (file_exists($target_file)) { echo "Sorry, file already exists."; $uploadOk = 0; } // Check file size if ($_FILES["fileToUpload"]["size"] > 500000) { echo "Sorry, your file is too large."; $uploadOk = 0; } // Allow certain file formats if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" && $imageFileType != "gif" ) { echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed."; $uploadOk = 0; } // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { echo "Sorry, your file was not uploaded."; // if everything is ok, try to upload file } else { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { echo "The file ". htmlspecialchars( basename( $_FILES["fileToUpload"]["name"])). " has been uploaded."; } else { echo "Sorry, there was an error uploading your file."; } } ?> */ ?>