Issue: when I try to embed a vimeo video into the media browser, I get the following error:
"https://vimeo.com/81819608 could not be added. Only the following types of files are allowed to be uploaded: audio, document, image, video"
I have media_vimeo installed at the latest version (7.x-2.0) and Media at the latest version (7.x-2.1). I have media_youtube installed as well, and youtube videos do upload.
The media player is enabled for vimeo...(Enter a URL to a file or media resource. Many media providers also support identifying media via the embed code used to embed the media into external websites.
Supported internet media providers: YouTube, Vimeo.)
Below is a screenshot of media browser with error message:

| Comment | File | Size | Author |
|---|---|---|---|
| #21 | file_entity-allowed-types-2874781-21.patch | 1.05 KB | cboyden |
| Screen Shot 2017-05-02 at 11.00.54.png | 64.96 KB | lauriekap |
Comments
Comment #2
hawkeye217 commentedSeeing the same thing but on media_vimeo 7.x-2.x-dev and Media 7.x-2.6.
Comment #3
hawkeye217 commentedActually, nevermind - my issue was config related. Not sure if the OP is still having an issue though.
Comment #4
joseph.olstadCurious, so what was your configuration solution?
Comment #5
joseph.olstadComment #6
nwehner commentedI'm having this same problem since upgrading to Media 7.x-2.10. Haven't yet found a configuration solution for it.
After pasting in a Vimeo URL and clicking the _next_ button I get: "https://vimeo.com/88819008 could not be added. Only the following types of files are allowed to be uploaded: video"
Any ideas on a workaround?
Comment #7
nwehner commentedFigured it out! Turns out the Media: Vimeo module doesn't respect "allowed file types" correctly in the field settings. I initially had the types restricted to allow only Video. I couldn't use Vimeo videos with that setting. However, unchecking all "allowed file types" (thus enabling the default to allow all types) allows Vimeo videos to be used.
Comment #8
sherkajon commented#7 worked for me. Thank you nwehner!
Comment #9
joseph.olstadhmm, sounds like a bit of a bug with the allowed file types functionality. allow video files should include web files like vimeo and youtube or at least allow choosing to allow those instead of bypassing all the allowed types by unchecking all of them.
bump this over to the media queue.
thanks for reporting.
Comment #10
joseph.olstadComment #11
cboyden commentedThis problem also happens with other types of files, not just video. If you have a field configured to only allow Document and Image, and you use the Web tab to input the URL of an image, you'll see the same error message.
However, if you have "Bypass file access control" turned on for the logged-in user, you don't get the message. You are able to successfully upload the image.
Comment #12
joseph.olstadok, thanks, I don't have time to fix this right now, but if you or someone else can that'd be great. I'll review the fix asap.
Comment #13
cboyden commentedFurther info, this problem doesn't happen when you go to /file/add/web, only when you try to use the web tab in the Media browser.
Comment #14
cboyden commentedI've been through this with a debugger and the only thing I can pin down is that file_entity_access() expects a filename string instead of a file object for the "create" op. But the media internet uploader passes in a null file object instead. The result of this is that the cache ID that controls access rights is set to a different value on each of two consecutive passes through the file_entity_access() function. (For existing files, the cache ID is the same on both passes through the function.) So new files fail the access check.
Comment #15
joseph.olstadIs there a parameter we need to add to the whitelist for the file object? See media.module , there is a whitelist there. Maybe good to check this whitelist? It is used by I believe the media browser popup
Comment #16
cboyden commentedI've been digging into the code some more, and I can't tell if the problem is in Media or File Entity.
The commit that breaks this is in File Entity: http://cgit.drupalcode.org/file_entity/commit/?id=27c1b77947d5ee69c1d388...
There are several problems with that update, I'm going to file a related issue on File Entity and see if fixing them also solves this problem.
Comment #17
cboyden commentedThis may be fixed by the patch in #2916585: Wrong file property used on file_entity_access.
Comment #18
joseph.olstadThe patch mentioned above has been committed to file_entity 7.x-2.x dev and 7.x-3.x dev.
if you experience this problem, upgrade to the 7.x-2.x dev version of file_entity OR file_entity 7.x-2.11 (has not yet been released)
Thanks to cboyden for the fix.
Comment #19
cboyden commentedUnfortunately the patch in #2916585: Wrong file property used on file_entity_access doesn't fix this issue.
Comment #20
cboyden commentedMoving this to file_entity.
The problem is in file_entity_file_entity_access. The hook should check for the Create operation first. Media doesn't set the is_new property on the file - and as far as I can tell, neither does file_entity or any core module - so new files will always fail the check that's currently running first.
Comment #21
cboyden commentedPatch is attached.
Comment #24
joseph.olstadlooks good, committed , thanks again!