开发者

Restricting open dialog box to certain files using javascript

When uploading photos and videos, the open dialog box should default to file su开发者_JAVA技巧ffixes that are relevant. e,d when i uploading images, it should show only file with extension .jpeg, jpg, gif, png, bmp etc. And same with videos..

Thanks.


You can't do that with JavaScript (possibly for security reasons). The "open file" dialog is handled by the browser's <input type="file"> control and not by JS code.

If it's an absolute necessity, consider a Java or Flash uploader applet - you'd have much more control over the UI there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜