1

I have been struggling put restriction for uploading video to upload only mp4 videos in media module, other media content like image etc. can be uploaded, but I need to put restriction for video type alone.

I am newbie in Drupal, can some one help me in this, what are the places I need to change in media module.

While Adding File

Restrict video upload to mp4 only

don't want other video format, only mp4

I would really appreciate any help on this. I did found sites\all\modules\media\includes\media.pages.inc file which had a function media_add_upload_validate($form, &$form_state) also then I found sites\all\modules\media\includes\media.variables.inc which had function media_variable_default and media_variable_get. Then I got lost. I am not sure if these are the correct files where I need to make the changes. Also I was wondering if I have to make change in Drupal core module to do the video upload restriction to mp4 perfectly.

Thanks

3
  • Thanks for whoever has up-voted this question to encourage me :)
    – Hitesh
    Feb 12, 2014 at 11:05
  • @Ajit Thanks for editing, really sorry for errors in asking question.
    – Hitesh
    Feb 12, 2014 at 11:06
  • No need to apologize. We all make mistakes ;-)
    – AjitS
    Feb 12, 2014 at 12:00

1 Answer 1

1

Go to admin/config/media/browser to change settings.

enter image description here

5
  • WOW :D ur awesome @Anil Sagar !!!! just one quick question will this modification be reflect in all the places or do i have to some other place as well, to make sure upload and error messages are changed correctly
    – Hitesh
    Feb 12, 2014 at 9:59
  • What do you mean by all places ?
    – Anil Sagar
    Feb 12, 2014 at 10:02
  • by all places i mean all the error messages which are displayed when i tried to upload other files like flv or mpeg?? Just wanted to make sure making change in this place is enough. Thank you so much for quick reply
    – Hitesh
    Feb 12, 2014 at 10:06
  • Yes, It's taken care by the module... The error messages that you see are rendered from a template..
    – Anil Sagar
    Feb 12, 2014 at 10:07
  • It is working great but it is taking time to show error, It is waiting for file to get uploaded and only after that it shows the error is there any way to show the error before file gets uploaded.
    – Hitesh
    Feb 17, 2014 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.