Skip to content

Add srcMaxSize option to viewers #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wabson opened this issue Jul 15, 2013 · 1 comment
Closed

Add srcMaxSize option to viewers #16

wabson opened this issue Jul 15, 2013 · 1 comment
Milestone

Comments

@wabson
Copy link
Member

wabson commented Jul 15, 2013

Similar to the built-in Image plugin, the Media Viewers plugins should support checking the file size of the source file, allowing administrators to configure a maximum file size beyond which the viewer will not be used.

@wabson
Copy link
Member Author

wabson commented Jul 15, 2013

Example code from Image.js

var srcMaxSize = this.attributes.srcMaxSize;
if (!this.attributes.src && srcMaxSize.match(/^\d+$/) && this.wp.options.size > parseInt(srcMaxSize))
{
    // File is too big
}

@wabson wabson closed this as completed in b04978c Oct 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant