Administrators Thanked: 265 times
This piece of code checks file extension, runs cot_file_check() to check if file contents is secure and uses cot_safename() to generate safe filename for storage:
$gd_supported
=
array
(
'jpg'
,
'jpeg'
'png'
'gif'
);
$file_ext
strtolower
end
explode
"."
$file
[
'name'
])));
$fcheck
= cot_file_check(
'tmp_name'
],
if
(in_array(
) &&
== 1)
{
]= cot_safename(
], true);
$filename_full
$usr
'id'
].
'-'
.
]);