Skip Navigation

[Resolved] File upload error

This support ticket is created 8 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 1.12 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 9 replies, has 2 voices.

Last updated by q1 8 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#341096

q1
Screen Shot 2015-10-20 at 15.13.59.png
Screen Shot 2015-10-20 at 15.13.11.png

Hi,

I am having a strange issue with an input file in a post form. The issue is that when I select a audio file I get the error message "Please enter a value with a valid extension."

Why is this error message showing up?

I attached a screenshot with the input in the frontend and its html. I added the accept attribute so that only mp3 files are allowed in the select file dialog.

Thank you for your help!

#341174

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for contacting our support forum.

I've tested this field on a demo site and it is working normally for me.

Could you follow the instructions in the link below and provide me with some debug information.
https://toolset.com/faq/provide-debug-information-faster-support/

Also please ensure that you are using he latest versions of our plugins.

Thanks,
Shane

#341196

q1

Hi,

thanks for the quick reply. I didn't know which debug information you need so I pasted the debug information of types and cred. Hopes this helps.

Yes, I have the latest version.

Thanks for the help!

#341205

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

I'm not seeing the debug information being attached.

We have a special field open for it, could you please try again.

Thanks,
Shane

#341336

q1

Hi,

in my last post I added both debug informations (types and cred) since I don't know which one you needed. But as it seems it didn't went through.

Now I am only adding the types debug information. If you need the other one I can add it in the next post.

Thanks!

#341530

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Actually all the debug information is the same so it does not matter which one you provided :).

I noticed that you have the duplicator plugin installed. Could you setup a package and provide to me so I can perform some testing to see why this issue is occurring on your end?

I'll enable the private fields so that that you can provide me with the duplicator package information.

Thanks,
Shane

#341778

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for providing the duplicator package.

So the form works fine and submits with all the information in tact including the field that was throwing the false error message.

Through testing it seems that the theme is causing this problem. If you were to switch the theme to a default wordpress theme then you will no longer see this message.

Thanks,
Shane

#341789

q1

Hi,

thanks for your feedback.

I checked what caused the issue in the theme and found out that this line

$('input[data-wpt-name="wpcf-audio-files"]').attr('accept', "audio/mp3");

provoked the error message. I added that line in order to restrict the selection of the files to mp3s only. But as it seems this would make the validation invalid.

Could you tell me why this would make the jQuery Validate used by the CRED post form to say that the file is invalid?

Thanks for your help!

#341793

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

I'm not sure why this is happening.

However what you can do is to try using the example below in the link to perform your field validations using jquery.
hidden link

You can also validate the fields using our CRED validation hooks which can be seen in the link below.
https://toolset.com/documentation/user-guides/cred-api/#cfv

Thanks,
Shane

#341843

q1

Hi,

thanks a lot for the links! I still don't know why the accept attribute triggers a invalid validation but now I can add my own rules.

And the hooks great for server-side validation.

Cheers!

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.