diff --git a/file-upload/fileupload.php b/file-upload/fileupload.php index c247042..7224255 100644 --- a/file-upload/fileupload.php +++ b/file-upload/fileupload.php @@ -16,7 +16,11 @@

Multiple File Upload

-
+ +
+ + +
@@ -57,18 +61,18 @@ $.fn.fileinputBsVersion = "3.3.7"; $("#files").fileinput({ theme: 'fas', - uploadUrl: '/file-upload/upload.php', // Replace with your actual upload URL + uploadUrl: '/all_scripts/file-upload/upload.php', // Replace with your actual upload URL uploadAsync: false, maxFileCount: 50, allowedFileTypes: ['image', 'video', 'pdf'], - showUpload: false, - showRemove: false, + showUpload: true, + showRemove: true, overwriteInitial: true, previewFileType: 'any', maxFileSize: 50000, // 50 MB in bytes fileActionSettings: { - showUpload: false, // This also hides the upload icon - showRotate: false // Hides the rotate button + // showUpload: false, // This also hides the upload icon + showRotate: false, // Hides the rotate button } }); }); diff --git a/file-upload/upload.php b/file-upload/upload.php index c4a546a..fb228aa 100644 --- a/file-upload/upload.php +++ b/file-upload/upload.php @@ -1,11 +1,11 @@ $name) { // Get file information - $tmp_name = $_FILES['files']['tmp_name'][$key]; + $tmpName = $_FILES['files']['tmp_name'][$key]; $size = $_FILES['files']['size'][$key]; $type = $_FILES['files']['type'][$key]; @@ -27,7 +27,7 @@ } // Check for file size - if ($size > 52428800) { // 1 MB limit + if ($size > 52428800) { // 50 MB limit $response['files'][] = ['name' => $name, 'error' => 'File size too large.']; continue; } @@ -36,7 +36,7 @@ $filename = uniqid() . '_' . $name; // Upload file - if (move_uploaded_file($tmp_name, $upload_dir . $filename)) { + if (move_uploaded_file($tmpName, $uploadDir . $filename)) { $response['files'][] = ['name' => $name, 'success' => 'File uploaded successfully.']; // Store additional information about the uploaded file in a database or other storage // ...