I’m working with a script where I use the PHP function copy() in order to save images from URL to my server: copy('http://si.com/guitar.jpg', 'guitar1213.jpg')
What I’m wondering is if there’s any way I can simply set a max file size limit when calling this function? Or is really .htaccess my only option to quickly fix this?
Thanks in advance
You can only get the file size once the file is on your server, I would recommend downloading the file to a temp folder and then you can easily check the file size and move to the correct location if it meets the requirements.