9 years ago
4
Topic

Dear Seblod Customer Sales,

Unfortunately we have got a serious trouble when we ask our clients to upload a file. We would like to limit its size . We set this limitation on seblod form although we didn't get any error message in the case our client wants to upload a huge file. How can we solve this issue. The file doesn't get into the DB but we absolutely need an error message when the file is selected .
Thanks in advance
Yours Sincerely...

Get a VIP membership
9 years ago
1
Level 1

Hi ng,

Thank you for your post.

The error message on the size limitation of an upload file field appears after the submission of a form.

Regards,
Mehdi.

ng
9 years ago
0
Level 2

Hi Mehdi!

Is it possible to get an error message before submission?

thank you very much!

9 years ago
1
Level 1

Hello bg,

you can add some javascript which test the size on the onchange event of the upload_file field.

$('#fieldID').on("change", function() {
  alert(this.files[0].size);
});

You can add that code in the script textarea of the configuration of the file, after clicking on the down orange arrow at the bottom of parameters.

Note that this will only work with modern browsers (IE>10).


Best regards.

Lionel

8 years ago
0
Level 2

Does it work without any updates on the proposed script? Or are there some placeholders which have to be replace with individual values? e.g. '#fieldID'?

I added the script to a field type 'file' (Upload - File) but there is no change to the reaction of the system. If the upload file is smaller than the maximum size the form will be closed, the mail sent out, and the expected response on the target url will be presented. If the upload file is greater than the maximum size the system presents the empty form again to start data entry.

Regards,
Heinz

Get a Book for SEBLOD