开发者

File Upload Field in EXT JS

I need to implement File Import functionality using EXT JS, I have gone through the examples it were helpful and clear.

Here now i need to import the file of type .txt alone.

For Eg : Once the import pop-up blow开发者_如何转开发s, then the "Files of Type should be *.txt"

Please provide the your valuable inputs.

Thanks Dinesh Kumar A B


Unfortunately, you cannot filter the actual File "Browse" window, unless you are using a Flash implementation or some other way of displaying that window. That window is handled by the browser, and is handled differently across OS' as well as browsers.

This is possible if you were say, writing a C# application, since that application would have access to the actual OS' window controls.

You could implement SWF Upload, or something similar which would allow you to do filtering based on file type.


The upload that you have seen in the examples uses TextField. You can configure it with a regex which allows only names ending with .txt

If the uses picks a non-txt file, the form becomes invalid and cannot be submitted.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜