TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   selecting file to upload (http://www.talkphp.com/general/5883-selecting-file-upload.html)

Tim Dobson 06-08-2011 03:06 PM

selecting file to upload
 
I just input a new upload script on my site. Works a wonder, all i want to do now is limit what files they can select to upload. I know you can allow them to upload only specific files but thats not what i mean. When the dialog opens to select the file off their machine i want it so they can only see .torrent files, rather than all files. I did a quick search on the web but was not sure what to search for and couldent get nothing out of what i did search for.

tony 06-08-2011 04:39 PM

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

AxelG 02-18-2012 09:42 PM

I had worked on something similar but I never found a solution. Not sure there is one.


All times are GMT. The time now is 06:37 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0