The user is to provide a URL from which the server will fetch a file using file_put_contents()
I would like to restrict the file size to 1MB
I am able to check the file size of some files prior to downloading using THIS solution. However not every HEAD request returns the size of a file prior to its download.
Is there a way to stop the download of a file to a server if the file size exceeds a certain number of bites?