TOPIC:

Attachment File Size Restriction 7 years 9 months ago #87876

  • Topic Author
  • mountain91074
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 9
  • Thanks: 0
Hi,

I'm very new on this and I apologize for my poor English.
Regarding BreezingForms(Quickmode), is there a way to set permitted max attachment file size without flash uploader ?

Please Log in or Create an account to join the conversation.

Re: Attachment File Size Restriction 7 years 9 months ago #87973

  • Syno
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 2186
  • Karma: 3
  • Thanks: 209
Hello,

yes, you can use a custom validation script for this.

Please go to your upload element -> validation->custom and copy the following code into the box:

function ff_NAMEOFUPLOAD_validation(element, message)
{ elem=element.files[0];
if (elem.size>8000) { // change 8000 to the value you need
if (message=='') message = elem.size+" faild in my test.\n"
ff_validationFocus(element.name);
return message;
} // if
return '';
} // ff_bfQuickMode4807667_validation


Now all you need to change is NAMEOFUPLOAD with the real name of the element and set the value to the size you need.


I hope this helps.

Regards,
Syno

Please Log in or Create an account to join the conversation.

Re: Attachment File Size Restriction 7 years 9 months ago #88033

  • Topic Author
  • mountain91074
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 9
  • Thanks: 0
Hi Syno,

Thank you very much.
I apologize this if this issue is already noted before.

Your validation code works perfect! Thank you.

But would you help me one more time?

Can I use your custom code with ff_valuenotempty?
( to limit max size but need to upload something )

I tried like
if (elem.size>8000 or elem.size==0)
but did not work.

Please Log in or Create an account to join the conversation.

Re: Attachment File Size Restriction 7 years 9 months ago #88144

  • Syno
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 2186
  • Karma: 3
  • Thanks: 209
Hello,

please try it with the following script.


function ff_NAMEOFUPLOAD_validation(element, message)
{
elem=element.files[0];
if(element.value==''){
if (message=='') message = " please provide Upload"
ff_validationFocus(element.name);
return message;
}else{
if (elem.size>8000) { // change 8000 to the value you need
if (message=='') message = elem.size+" faild in my test.\n"
ff_validationFocus(element.name);
return message;
} // if
}
return '';
} // ff_bfQuickMode4807667_validation



Let me know if this helps.


Regards,
Syno

Please Log in or Create an account to join the conversation.

Re: Attachment File Size Restriction 7 years 9 months ago #88660

  • Defiler's Avatar
  • Defiler
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 30
  • Thanks: 0
I need the same thing and neither one of these worked for me. Trying to limit the size to 2MB. When submitting it always asks me to fill in the field (I have it as required) regardless if the file is over or under the size limit. please help!

This is what I have in the field.

function ff_bfQuickMode66563_validation(element, message)
{
elem=element.files[0];
if(element.value==''){
if (message=='') message = " please provide Upload"
ff_validationFocus(element.name);
return message;
}else{
if (elem.size>2048) { // change 8000 to the value you need
if (message=='') message = elem.size+" faild in my test.\n"
ff_validationFocus(element.name);
return message;
} // if
}
return '';
} // ff_bfQuickMode66563_validation

Please Log in or Create an account to join the conversation.

Last edit: Post by Defiler.

Re: Attachment File Size Restriction 7 years 9 months ago #88930

  • Syno
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 2186
  • Karma: 3
  • Thanks: 209
Hello,

could you please provide a link to the form or better a package of your form? This would make troubleshooting a bit easier.

How to create packages you can find here:

crosstec.org/support/index.php?pid=knowl...=viewentclient&id=77


Regards,
Syno

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.052 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!