update (09 DEC 2017):
I want prevent uploading file more than 100 KB on server from users and during uploading, if the upload volume exceeds 100 kilobytes, stop uploading progress and display warning for user by PHP OR any other script for server-side code.
***OR how can I display an error message to user by getting maximum size of file from php or Apache after set maximum_file_size in php.ini (upload_max_filesize -- post_max_size )OR Apache configuration***
I have an page with php code to upload user's picture for every account.Size of their image file must less than 100 kb size.
how can I stop uploading file if size of temporary file uploaded was more than specific size while uploading is in process By PHP.(e.g. more than 100KB)?? I want make a server-side code to check that rather than client-side.
and a way to set time out in server-side 30 seconds or 1 minutes for uploading.how can I do this?? I'm not very good in php.please help me. Thanks.
Thanks for ALL Answer BUT I want code to run on SERVER and while uploading is in process. Means before finishing uploading on server to avoid the use of bandwidth by hackers and other ,(NOT after uploading), by PHP OR any other script for server-side code