Mime-types url validation

Support General Mime-types url validation

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #9153
    lhkeeperlhkeeper
    Participant

    Dear Support,

    I have a problem with URL validation. I used the basic 'url' rule to check if the inserted text is in URL format, but I have no idea how to check the mime-type (only video URL is allowed) as the additional rule - 'extension' doesn't seem to be working.

    I will appreciate any help on this matter.
    Best,
    Kasia

    #9181
    Anh TranAnh Tran
    Keymaster

    Hi Kasia,

    Which field type are you using? How do you setup the validation?

    #9207
    lhkeeperlhkeeper
    Participant

    Hi Anh,

    Please look at my code below:

    https://pastebin.com/Q8xf3tXS

    I'm using "url" type field as the videos will be stored in the other place.
    Thank you

    #9229
    Anh TranAnh Tran
    Keymaster

    Hi Kasia,

    If you want to verify mime-type, it's best to write a custom validation rule for entered URL.

    I created an example for checking with MP4 file:

    https://pastebin.com/ScH6CDvQ

    For writing custom validation rule, please see this:

    https://jqueryvalidation.org/jQuery.validator.addMethod/

    #9238
    lhkeeperlhkeeper
    Participant

    Thank you very much Anh.
    Have a great day!
    Kasia

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Mime-types url validation’ is closed to new replies.