TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-08-2011, 03:06 PM   #1 (permalink)
The Contributor
 
Tim Dobson's Avatar
 
Join Date: Feb 2010
Posts: 69
Thanks: 16
Tim Dobson is on a distinguished road
Default 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.
Tim Dobson is offline  
Reply With Quote
Old 06-08-2011, 04:39 PM   #2 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 312
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
Old 02-18-2012, 08:42 PM   #3 (permalink)
The Wanderer
 
AxelG's Avatar
 
Join Date: Feb 2012
Posts: 16
Thanks: 0
AxelG is on a distinguished road
Default

I had worked on something similar but I never found a solution. Not sure there is one.
AxelG is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
E mail on file upload? Tim Dobson General 1 02-16-2010 05:49 AM
Upload file from textbox dhaval Absolute Beginners 2 12-25-2009 07:26 PM
HELP! File Upload d4v1d General 2 09-12-2008 06:52 PM
upload file galleeandfarel Absolute Beginners 2 07-11-2008 11:23 AM
Accessing Variables from Conf file to Upload Class Gareth Absolute Beginners 10 02-22-2008 12:27 AM


All times are GMT. The time now is 10:28 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design