I'm finally resorting to setting a maxSize value in CKFinder in my web app. Doing a bit of testing to see if it works as expected (i.e. upload whole file, then get rejection if too big) is fine.
But, the message displayed when this occurs is half useless. "Invalid file. The file size is too big." Yeah - but what's "too big"? Why doesn't this message also include the max file size, i.e. "The maximum size for files is 500kb" (or whatever the limit is set at for that resource type)?
I'll be listing the imposed limits elsewhere, but those will be glossed over and forgotten - having the limits show up *right there* when a client is trying to upload a file and hitting the limit would be far more useful.
But, the message displayed when this occurs is half useless. "Invalid file. The file size is too big." Yeah - but what's "too big"? Why doesn't this message also include the max file size, i.e. "The maximum size for files is 500kb" (or whatever the limit is set at for that resource type)?
I'll be listing the imposed limits elsewhere, but those will be glossed over and forgotten - having the limits show up *right there* when a client is trying to upload a file and hitting the limit would be far more useful.
Re: Displaying maxSize value to end users when tripping limi
Re: Displaying maxSize value to end users when tripping limi
I've got my "image" max filesize at 300kb and "file" max filesize at 2mb. One of our clients has an intern who's got zero clue on what she's doing, uploading raw images off digital cameras. (I'll save you the rant.) Since these files would not upload into the "image" area, she just switched over to the "file" area and began uploading there - and hence began tripping the thumbnail creation there.
And seeing that she apparently uploaded three of these huge images at once, all three thumbnail creation processes went off about the same time, which crippled my webserver. (I suspect our server has some deeper config issues which make it vulnerable to such things - that's a whole different thing as well.)
I'd prefer to have thumbnails working for images, but *not* for files.
Uploading a 2mb+ Excel file into my file area, the maxsize kicks right away - doesn't even try. Uploading a 2mb+ JPG into that area - it uploads the whole file before checking the size. I assume it's after the upload that it checks to see if the resize is enabled, finds it's not, and then rejects - the resize function should be checked first, to see if it's enabled, before accepting a too-large typical image file, and should reject too-large images straight away like it does with non-images.
I imagine there's many config options in CKFinder that are global to the app, but would work just fine if separated by file type.
Re: Displaying maxSize value to end users when tripping limi
The rest of your comments are request for features that aren't available at the moment AFAIK, but this one is already available, you can find this in your config file:
So flipping that preference should be able to reject the image before trying to resize it.
Re: Displaying maxSize value to end users when tripping limi
I was saying images that are bigger than the max size setting, regardless of the auto-rescale setting, should be rejected straight up, based on the file size (which is obviously available prior to the whole file upload).
If the resize function is disabled, a too-big image file is rejected right off the bat.
If the resize function is enabled, a too-big image is allowed to upload, and then a resize attempted, and if *that* image is too big, *then* it's rejected.
I'm kinda after a middle-ground - a way to auto-reject too big files based on the original size, and still allow a resize if the original file size is within the set limit (if any).
Re: Displaying maxSize value to end users when tripping limi
Using the asp connector, I have CheckSizeAfterScaling set to true.
Maximum image dimensions as 500x400
and Maximum size in the Images resource type set to 100Kb.
Now I select a 2560x1600px image, it weights 420 Kb, but as the setting is set to check the size afterwards, the file is sent to the server, then it's resized and it turns out that it generates a 500x312px that weights only 32Kb. So it has been accepted.
Next test is to flip the setting in config.asp and reload CKFinder, now when I try to select that same image to be uploaded again the file is rejected right away, it doesn't reach the server at all. The uploader sees that 420Kb is bigger than the allowed 100Kb for Images so it doesn't even try to upload and resize it.
Does that match your tests?
Is there anything wrong here?