View Single Post
Old 06-08-2011, 04:39 PM   #2 (permalink)
tony
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

There is a standard for an accept attribute, but it is not widely supported in browsers. I am afraid you are trapped in front-end support dark zone on this one. I think only opera and chrome browsers support his. And even if they are supported, the only standard mime type for a torrent file there is are bittorrent files.

So you can try using
HTML Code:
<input type="file" accept="application/x-bittorrent" name="werew" />
but it is not guaranteed it will work in all the browsers.
You can try use javascript, to verified only. I don't think it would let the dialog to only show .torrent files.

There are also some flash laternatives, like uploadify

But there is no sane option in this problem.

P.S. I think this thread fits better under TalkPHP > Misc. Support & Development » Javascript, AJAX, E4X
tony is offline  
Reply With Quote