TOPIC:

File upload message when file contains special character 1 month 3 weeks ago #264745

  • Topic Author
  • sly123
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 78
  • Thanks: 1
Hello,
we are having issues where users are uploading files with special characters. The problem is the form doesn't throw an error when submitting it just goes back to the form with everything empty and no message at all.

Is there any ability to validate the file upload or display an error message when that type of error happens?

Any help would be greatly appreciated.
Thanks so much,

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

File upload message when file contains special character 1 month 3 weeks ago #264767

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 7799
  • Karma: 3
  • Thanks: 550
Hi,

are you using HTML5 upload, or defualt upload, than I will test it?

Regards,
Tihana

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

File upload message when file contains special character 1 month 3 weeks ago #264771

  • Topic Author
  • sly123
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 78
  • Thanks: 1
Hello,
We are using the default upload. Thanks.

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

File upload message when file contains special character 1 month 3 weeks ago #264778

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 7799
  • Karma: 3
  • Thanks: 550
Hi,

pleae add this to upload element->Properties->Validation->check Custom and put:
function ff_upload_validation(element, message)
{
var children = jQuery('#ff_elem1571').val();
var reg= /\b(www|google|captcha|click|link|search)\b/ig;
if (children> 1 || children < 1 || (reg.test(children))) {
if (message=='') message = element.name+" faild in my test.\n"
ff_validationFocus(element.name);
return message;
} // if
return '';
}
Please replace:
-upload with name of your upload element (not title)
-#ff_elem1571 with ID of your upload file, to find ID please do the right click to your browser->Inspect->and find ID for file upload
-www|google|captcha|click|link|search with specific characters you want to prevent

Let me know if you need more help

Regards,
Tihana

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

File upload message when file contains special character 1 month 3 weeks ago #264863

  • Topic Author
  • sly123
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 78
  • Thanks: 1
How can we handle this for a form with multiple uploads. Is there an option to do this globally? Do i have to list all of the special characters just to be sure?
Any help is greatly appreciated.

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

File upload message when file contains special character 1 month 3 weeks ago #264865

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 7799
  • Karma: 3
  • Thanks: 550
Hi,

you mean with multiple file uploads? Because in default upload you can upload only one file

If yes, then add validation for each file upload, just replace #ff_elem1571 with Id of each upload, and instead of upload put name of file upload

Regards,
Tihana

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

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.039 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!