Hello.
I should check if the uploaded file has right extension,
and type.
I can get the filetype by File::Type module
So now the type could look like this:
image/x-png
How can I get the first word (image)of that line?
If I could get that word, then I would be able to check is the uploaded file really a image.
Second question:
Does anybody a good method how I could read/check the file extension? I allow only these extensions: (jpg, gif, or png).
I should check if the uploaded file has right extension,
and type.
I can get the filetype by File::Type module
Code:
my $type = $ft->checktype_filename($file);
image/x-png
How can I get the first word (image)of that line?
If I could get that word, then I would be able to check is the uploaded file really a image.
Second question:
Does anybody a good method how I could read/check the file extension? I allow only these extensions: (jpg, gif, or png).