├── README.md ├── add-file.php ├── create-directory.php ├── css └── style.css ├── delete-file.php ├── file-size.php ├── index.php ├── main-file-size.php ├── main.js ├── navigate.php ├── print-directory.php ├── print-file.php ├── remove-directories.php ├── rename-directory.php ├── root ├── pepito │ ├── Por qué te crees tus excusas y cómo dejar de hacerlo.pdf │ └── html-handbook.pdf └── perro │ └── MicrosoftTeams-image (10).png ├── search-file.php ├── show-icon.php └── src └── img └── icons ├── csv.png ├── doc.png ├── exe.png ├── jpg.png ├── mp3.png ├── mp4.png ├── odt.png ├── pdf.png ├── png.png ├── ppt.png ├── rar.png ├── txt.png └── zip.png /README.md: -------------------------------------------------------------------------------- 1 | # Local FileSystem Explorer - PHP Project 2 | 3 | In this project we have created a **file explorer** that allows the user to browse, create directories and upload files, in order to keep them in a more comfortable way 4 | 5 | 6 | ## Developed with 7 | 8 | - HTML 9 | - CSS 10 | - JS 11 | - PHP 12 | 13 | ## TEAM 14 | 15 | - [Víctor](https://github.com/victor-gv) 16 | - [Jesús](https://github.com/Jesusjha) 17 | -------------------------------------------------------------------------------- /add-file.php: -------------------------------------------------------------------------------- 1 | .list-group-item { 43 | border-width: 0 0 1px; 44 | } 45 | 46 | .list-group-item+.list-group-item { 47 | border-top-width: 0; 48 | } 49 | 50 | .py-1 { 51 | padding-top: .25rem !important; 52 | padding-bottom: .25rem !important; 53 | } 54 | 55 | .list-group-item { 56 | position: relative; 57 | display: block; 58 | padding: .5rem 1rem; 59 | text-decoration: none; 60 | background-color: #fff; 61 | border: 1px solid rgba(0, 0, 0, .125); 62 | } 63 | 64 | .radius-15 { 65 | border-radius: 15px; 66 | } 67 | 68 | .fm-icon-box { 69 | font-size: 32px; 70 | background: #ffffff; 71 | width: 52px; 72 | height: 52px; 73 | display: flex; 74 | align-items: center; 75 | justify-content: center; 76 | border-radius: .25rem; 77 | } 78 | 79 | .font-24 { 80 | font-size: 24px; 81 | } 82 | 83 | .ms-auto { 84 | margin-left: auto !important; 85 | } 86 | 87 | .font-30 { 88 | font-size: 30px; 89 | } 90 | 91 | .user-groups img { 92 | margin-left: -14px; 93 | border: 1px solid #e4e4e4; 94 | padding: 2px; 95 | cursor: pointer; 96 | } 97 | 98 | .rounded-circle { 99 | border-radius: 50% !important; 100 | } 101 | 102 | 103 | -------------------------------------------------------------------------------- /delete-file.php: -------------------------------------------------------------------------------- 1 | alert('File deleted successfully');window.location= 'index.php'"; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /file-size.php: -------------------------------------------------------------------------------- 1 | = 1073741824) { 5 | $bytes = number_format($bytes / 1073741824, 2) . ' GB'; 6 | } elseif ($bytes >= 1048576) { 7 | $bytes = number_format($bytes / 1048576, 2) . ' MB'; 8 | } elseif ($bytes >= 1024) { 9 | $bytes = number_format($bytes / 1024, 2) . ' KB'; 10 | } elseif ($bytes > 1) { 11 | $bytes = $bytes . ' bytes'; 12 | } elseif ($bytes == 1) { 13 | $bytes = $bytes . ' byte'; 14 | } else { 15 | $bytes = '0 bytes'; 16 | } 17 | 18 | return $bytes; 19 | } -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | File Manager 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
33 |
34 |
35 |
36 |
37 |
38 | 42 | 43 |
44 | 45 | 46 |
47 | 48 | 49 | 50 | 51 | 52 | 78 |
79 | 80 | 81 | 103 | 104 |
My Drive
105 |
106 |
All 108 | Files 109 | My Devices 111 | Recents 113 | Important 115 | Deleted Files 117 | 118 | Documents 119 | Images 121 | Videos 123 | Audio 125 | Zip Files 127 |
128 |
129 |
130 |
131 |
132 |
133 |
45.5 GB 50 134 | GB
135 |

UsedUpgrade 137 |

138 |
139 |
141 |
143 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
Images
152 |

1,756 files

153 |
154 |
15.3 GB
155 |
156 |
157 |
158 |
159 |
160 |
Documents
161 |

123 files

162 |
163 |
256 MB
164 |
165 |
166 |
167 |
168 |
169 |
Media Files
170 |

24 files

171 |
172 |
3.4 GB
173 |
174 |
175 |
176 |
177 |
178 |
Other Files
179 |

458 files

180 |
181 |
3 GB
182 |
183 |
184 |
185 |
186 |
187 |
Unknown Files
188 |

57 files

189 |
190 |
178 GB
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 | 208 | 209 |
Folders
210 |
211 | 214 | 215 | 216 | 217 |
218 | 219 |
220 |
221 |
Folders info
222 |
223 | 226 |
227 |
228 | 229 | 230 | 231 | 232 | 234 | 235 | 236 | 237 | 238 | 239 |
Name 233 | Creation dateLast ModifiedSize
240 | 241 | 0) { 245 | foreach($directories as $direct) { 246 | $totalSize = 0; 247 | $directory = "./root/" . $direct; 248 | $directorySize = filesize($directory); 249 | $directoryTimeModify = date("F d Y H:i:s.", filemtime($directory)); 250 | $directoryCreationDate = date("F d Y", filectime($directory)); 251 | 252 | $files = array_slice(scandir("./root/" . "/" . $direct), 2); 253 | foreach($files as $pos => $file) { 254 | $rootSize = "./root/" . $direct . "/" . $file; 255 | $showSize = filesize($rootSize); 256 | $totalSize += $showSize; 257 | } 258 | echo " 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 |
$direct$directoryCreationDate$directoryTimeModify" . fileSizeUnit($totalSize) . "
"; 271 | 272 | 273 | 274 | 275 | 276 | 277 | } 278 | } 279 | ?> 280 |
281 |
282 |
283 |
284 |
285 |
286 | 287 | 288 | 289 | -------------------------------------------------------------------------------- /main-file-size.php: -------------------------------------------------------------------------------- 1 | $file) { 5 | $rootSize = "./root/" . $direct . "/" . $file; 6 | $showSize = filesize($rootSize); 7 | } 8 | } -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | const openEditFolderModal = (folderName) => { 2 | const modal = document.getElementById("exampleModalCenter"); 3 | $("#exampleModalCenter").modal("show"); 4 | const inputOldName = document.getElementById("inputOldName"); 5 | inputOldName.value = folderName; 6 | }; 7 | 8 | -------------------------------------------------------------------------------- /navigate.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | File Manager 18 | 19 | 20 | 21 |
22 |
23 |
24 | 25 |
Folder: 26 | 29 |
30 |
31 | 32 |
33 | 36 |
37 | 38 | 39 | 40 |
41 | 42 |
43 |
44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /print-directory.php: -------------------------------------------------------------------------------- 1 | 0) { 7 | foreach($dirs as $pos => $dir){ 8 | if (is_dir("./root/$dir")){ 9 | echo "
10 |
11 |
12 | 23 | 24 | 25 | 26 |
27 | 28 |
29 |
30 |
31 |
"; 32 | } else { 33 | echo "
34 |
35 |
36 | 48 | 49 | 50 | 51 |
52 | 53 |
54 | 55 | 56 |
57 |
58 |
"; 59 | } 60 | 61 | 62 | 63 | } 64 | } 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /print-file.php: -------------------------------------------------------------------------------- 1 | alert('File uploaded successfully');window.location= 'index.php'"; 18 | } 19 | 20 | } 21 | 22 | 23 | 24 | 25 | $dirs = array_slice(scandir("./root/" . $folderName), 2); 26 | //loop through the array and print the names of the directories 27 | if (count($dirs) > 0) { 28 | foreach($dirs as $pos => $dir){ 29 | $file = "./root/" . $folderName . "/" . $dir; 30 | $fileName = $dir; 31 | $bytes = filesize($file); 32 | $fileExt = explode(".", $fileName); 33 | $fileOnlyExt = strtolower(end($fileExt)); 34 | $fileTimeModify = date("F d Y H:i:s.", filemtime($file)); 35 | $fileCreationDate = date("F d Y H:i:s.", filectime($file)); 36 | 37 | 38 | echo "
39 | 40 |
41 |
42 | 43 |
$dir
44 | 45 |
46 | 47 | 48 |
49 |
50 |
51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
Creation dateLast Modified DateExtensionSize
$fileCreationDate$fileTimeModify$fileOnlyExt" . fileSizeUnit($bytes) . "
70 | 71 |
72 |
73 |
"; 74 | } 75 | } 76 | ?> -------------------------------------------------------------------------------- /remove-directories.php: -------------------------------------------------------------------------------- 1 | 0) { 8 | foreach($dirs as $pos => $dir){ 9 | $files = array_slice(scandir("./root/" . $dir), 2); 10 | foreach ($files as $pos => $file) { 11 | $path = "./root/" . $dir . "/" . $file; 12 | $fileExt = explode(".", $file); 13 | $fileOnlyExt = strtolower(end($fileExt)); 14 | 15 | 16 | $result = (strpos(strtolower($file), strtolower($searchString))); 17 | if ($result !== false){ 18 | echo "
19 | 20 |
21 |
22 | 23 |
$file
24 |
25 |
26 |
"; 27 | } 28 | } 29 | } 30 | } 31 | 32 | ?> 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | File Manager 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /show-icon.php: -------------------------------------------------------------------------------- 1 |