Hello,
 
I have a perl program that allows a user to upload a file (either .jpg or
.gif) to the server, and returns a message if it exceeds a specified size
(in my case 100kB).  Currently (and don't laugh - I am new to perl), I go
through the motions of uploading the file in 1024-byte blocks (in binary
mode), and increment a counter with each block.  If the counter exceeds 100
(i.e. greater than 100kB), then it exits the loop, displays a warning
message and deletes the file.
 
I am sure there would have to be an easier and more efficient way of doing
this - that is, somehow finding out how large the file is without having to
download it first.
 
Does perl have a module that can check the size of the file?  And for that
matter, its type (.jpg, .gif etc.)?
 
Thanks in advance,
Mike.

Reply via email to