Limit filesize of images videos uploaded Membership Access

ok here goes, i have been pondering on this for some time. there needs to be some method of limiting the filesize of images that are uploaded. yes we set the max_upload_size in the php configuration, though this is not what i am talking about. that sets the overall upload limit, and that is fine. what needs to be done is have the ability from the admin panel based on membership levels if possible, to limit the image sizes, audio sizes, and video sizes. now why do you think i mention image sizes, with the age of technology, and digital cameras, many are taking pictures that have high resolution, and are not web publishing compatible, so you end up with an image the size of 3800x2300 or something. with both bandwidth and diskspace being considered here, there should be a means of forcing a crop o the images that are outside a defined spectrum 800x600 is plenty when considering that avatars are force cropped. videos, kind of the same situation, where you want to allow all to upload videos, we should be able to as the admin, limit the filesize per membership level, yes we can limit the actual number of videos uploaded and again, the max_upload_size in general is set from the php config, but that is not enough, this needs to be controlled from the admin panel, and not dependant on the server setting. same with audio files, but they truly present the least of the concern here, but should still have some method of managing the file size that is uploaded from the admin panel this needs to be a default function, not something that is written and sold in the market for $40.00
When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support
Quote · 23 May 2011

The problem is as you say, setting the limits in php and / or nginx (as i use) will limit it globaly.

Solution would be to use a flash uploader that runs on the client side that have parameters fetched when it starts what limits should be applied and then restrict it before posting the file to /upload.php on the server side.

If a normal post upload is used you simple have to check the posted size and determind if the file should be allowed or not, but the problem there is that the file needs to be uploaded first to the server consuming bandwith.

I think you can manage to modify the flash uploader if you have the source to built in a variable that sets how big the file can be for upload and when selecing a file, flash can see the file size and accept / reject it.

I only see 2 ways of this, Dolphin needs to build in limits of file size, that the normal post upload supports and that a modified flash uploader can handle this as well.

 

Quote · 24 May 2011

This problem has been in the back of my mind since I started using dolphin, really wish it was something they had taken into consideration when communities really thrive on uploaded media.

 

My bandaid fix, which I have yet to implement, is to run a cron job and resize all originals to say 1024x768 max. I just haven't perfected it to run on my VPS yet (targeting only the originals is proving difficult) - and it still doesn't solve the issue of the bandwidth used on the front end of uploading the files from the clients end, but with a relatively inactive community I'm too worried about that part yet.

 

Skype: shawn.nelson
Quote · 24 May 2011

Not sure on how to do this on membership levels yet, but i believe i found where to set sizes.

I believe in all newer versions of dolphin, file size limits in dolphin are obtained from the PHP INI max upload setting as per this code in inc/classes/BxDolFilesUploader.php at line 66 in the BxDolFilesUploader function

        $this->iMaxFilesize = return_bytes(ini_get('upload_max_filesize')); //max allowed from php.ini
        $this->sMultiUploaderParams = array( //Important! Should be override with necessary params
            'accept_file' => '', //Important! Current file non exist. Should be override with accepting file (addFile.php)
            'multi' => 'true',
            'auto' => 'true',
            'accept_format' => '*.*',
            'accept_format_desc' => 'All Files',
            'file_size_limit' => $this->iMaxFilesize, //Examples: 2147483648 B, 2097152, 2097152KB, 2048 MB, 2 GB
            'file_upload_limit' => '10',
            'file_queue_limit' => '5',
            'button_image_url' => BX_DOL_URL_PLUGINS . 'swfupload/images/XPButtonUploadText_61x22.png',
        );
    }


I have yet to test this to see if it affects photos as well. I think it does as dolphin shares a lot of things and i believe all uploaded files are handled by the same uploader functions.

https://www.deanbassett.com
Quote · 25 May 2011
I noticed in the flash uploader the file_size so I 'assume' the function are global for all the types of upload methods and all we need is to be able to add a field to each group setting maxupload size. Problem still exist for normal file upload since you don't know the file size until the file is uploaded to your tmp dir, after that you can detect file size and reject the upload, but then you have wasted some bandwidth. After all it's a good thing for Boonex to improve Dolphin with. Simple hate to spend 5 minutes to install dolphin and 3 hours to 'patch' the system for making it better special if the modification is an easy part to 'fix' for boonex in the first place.
Quote · 28 May 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.