Just maintain a field in database which saves the last file upload date and time and if the uploads reach to the limit of 5 then before uploading file check that last file upload time. If the difference between last file upload time and current time is greater than 2 minutes then allow the file to be uploaded otherwise give message to the user to wait before he can upload next file.
solved File upload time limitation [closed]