| | |||||
| ||||||||
| Web Design Discussion Discussion of web design techniques, advice, browser issues, software, design firms. |
![]() | NamePros Design Contests | Forum Sponsorship |
| Join in on the FUN! You can start an affordable design contest and pick from entries talented members submit or you can enter a design contest for a chance to win CASH PRIZES! What are you waiting for? Get started in the fun TODAY! - Banners, Logos, Mascots, and MORE! (Please READ the design Contest section rules Prior to starting or entering a contest) | ||
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: May 2003
Posts: 2,187
![]() ![]() ![]() | a question about the file form tag hi, a mate at work is making something and needs to upload images thing is tho he cant use gifs (long story) hes got the form tag Code: <input type="file" name="F1" size="20"> but he wants a mod to allow people only select jpgs so in the file format thing instead of displaying all files etc etc he wants jpg supports anydieas? cheers |
| |
| | #2 (permalink) |
| Senior Member Join Date: Aug 2002
Posts: 1,255
![]() ![]() | It would probably be best to use JavaScript to check for that before the file upload is actually attempted. Try this script. :webdev: |
| |
| | #6 (permalink) |
| Senior Member Join Date: Aug 2002
Posts: 1,255
![]() ![]() | I think you can check for file types with PHP by doing something like this: PHP Code: More info here: http://us3.php.net/features.file-upload :beer: |
| |
| | #8 (permalink) |
| First Time Poster! Join Date: Jun 2003
Posts: 1
![]() | Im not worried about validating the file type Hi thanks for the help on this (im the mate adam is refering to). What im actually trying to is set the file field so that when you click browse jpg is the only selectable file type from within the browse window's file type drop down. I'm sure ive seen this done before i just cant remember where! Any and all help is appreciated. Cheers Carl |
| |
| | #9 (permalink) |
| Senior Member Join Date: Aug 2002
Posts: 1,255
![]() ![]() | I think I may have seen that done somewhere also, but I don't know how or if it's even possible to do from a web page. I imagine vbScript would probably be something that you may be able to do that with, but I really don't know much about vbScript/asp. There's the accept attribute that you can use to list what content-types the server can handle correctly. If I ever learn how to do what you're wanting, I'll be sure to post it here. |
| |