The vB Geek

The vB Geek (http://www.thevbgeek.com/index.php)
-   Geek Article and Review System (http://www.thevbgeek.com/forumdisplay.php?f=26)
-   -   Limit file upload size (Thumbnail to original image upload) (http://www.thevbgeek.com/showthread.php?t=4073)

-RL- 03-21-2008 12:35 AM

Limit file upload size (Thumbnail to original image upload)
 
Hi

is it possible to limit the filesize for uploaded images?
I've set it to 30000 for a custom field (Thumbnail to original image upload), but I'm still able to upload images well over 200k.
Does that setting only limit the thumbnail size and not the actual image file itself??

I've got the "Maximum upload size in bytes" in setting set to 100000, but that's for header images only, right?


Thanks in advance. :)

Morgan 03-24-2008 05:25 PM

When doing thumbnail to original image, the original image is not resized. vB 3.7 has a new function called fetch_best_resize and the GARS geek_class_upload.php file has some untested code that is commented out to make use of that function. Again it is untested code and only for those using vB 3.7 and up. You can try uncommenting the three blocks of code that are commented out in the geek_class_upload.php file and see if it works, assuming you are using vB 3.7 and up, or you'd need to take the if ($this->dooriginal) block of code in the geek_class_upload.php file and make it similar to the if ($this->dothumb) block of code in the geek_class_upload.php file if you want to make the original image a thumbnail too. Alternatively you could add the following to the GARS_custom_thumbnail template to try and limit filesize from the client-side, where X is a number in bytes:
Code:

<input type="hidden" name="MAX_FILE_SIZE" value="X" />


All times are GMT. The time now is 12:43 PM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.