check max file size at client before sent to server

when try to upload a file which is bigger than the max file size, there will be many error "invalid file type" in the ticket thread.

this is not best solution, since the problem is in the server side code.