Forums

How can I get upload file size limit to work?

LAMF 23 May, 2012
Hi,
I have got several forms to work now but the latest one has a little error.
I want it to alert the submitter of the form that when he is attaching an image as a file (which is compulsory) the file size has to be at least 50kB in size (this is to be sure the image is of decent quality). Everything works except for the warning message that the file is too small.
If I try to submit the form without adding any picture it wont work which is fine but if the picture is too small(less that 50kB) it still proceeds but the image is not attached.
So it works partly ok by not uploading the image but no warning is displayed and that's not so good.
How can i get this warning message working?
GreyHead 26 May, 2012
Hi LAMF,

What settings have you got in the Upload Files action?

Do you have an Event Loop in the On Fail event of the action?

Bob
LAMF 31 May, 2012
Hi Greyhead,
I have these settings in the actions for Upload Files:

Enabled: Yes
Files: bild1:jpg-png-gif-tif-tiff-zip-rar-doc-docx-pdf-ai-eps,bild2:jpg-png-gif-tif-tiff-zip-rar-doc-docx-pdf-ai-eps,bild3:jpg-png-gif-tif-tiff-zip-rar-doc-docx-pdf-ai-eps
Upload Path: images/evenemang/fiskjakten
Max Size in KB: 2500
Min Size in KB: 50
Max Size Error Message: Fel storlek! Du har försökt ladda upp en för stor fil, max filstorlek är 2,5MB.
Min Size Error Message: Fel storlek! Du måste ladda upp en fil på minst 50KB.
File type Error Message: Fel filtyp! Filtypen du försöker bifoga är ej tillåten.
Safe File name: Yes

No I didn't have any Event Loop in the On Fail event. I'll check out that one...
GreyHead 31 May, 2012
Hi LAMF,

You need the Event Loop action in the On Fail event - otherwise ChronoForms assumes that the uploads and size checks were all successful.

Bob
LAMF 31 May, 2012
Hi Bob,

I have added the eventloop in the On Fail event and now that part works fine.
But another thing that don't seem to work is the captcha.
If I just try to leave it blank then it stops the form from submitting but if just type something that doesn't match the Captcha code it submits without any error and even reches the recipient.
Captcha works if the image size is ok even if I don't type the right characters in the field...

What canbe wrong here?
GreyHead 31 May, 2012
Hi LAMF,

A missing Event Loop again??

Bob

There are a series of videos here that will help you get started with CFv4.
LAMF 31 May, 2012
Hi Bob,

Ohh yes that was the missing thing also here.
Thanks for all the help with this.

BR
Micke
This topic is locked and no more replies can be posted.