-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd_image.php
More file actions
53 lines (27 loc) · 819 Bytes
/
add_image.php
File metadata and controls
53 lines (27 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
50
51
52
53
<?php
# require GabrielImage in this file
function addImage(array $data) {
GabrielImage::addImage($data);
# implementation has been moved to GabrielFirebase;
}
function deleteFileIfExists($filePath) {
if (file_exists($filePath) && is_file($filePath)) {
if (unlink($filePath)) {
return true;
} else {
return false;
}
}
}
function deleteFileByKey($key) {
$files = glob($key . '.*'); // Match any file with any extension
foreach ($files as $file) {
if (file_exists($file)) {
unlink($file); // Delete the file
echo "Deleted: $file\n";
} else {
echo "File does not exist: $file\n";
}
}
}
?>