NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Web Design Discussion
Reload this Page a question about the file form tag

Web Design Discussion Discussion of web design techniques, advice, browser issues, software, design firms.

Advanced Search
10 members in live chat ~  
NamePros Design Contests 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)



Closed Thread
 
LinkBack Thread Tools
Old 06-20-2003, 06:27 AM THREAD STARTER               #1 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer

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
adam_uk is offline  
Old 06-20-2003, 10:14 AM   #2 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



It would probably be best to use JavaScript to check for that before the file upload is actually attempted.

Try this script. :webdev:
deadserious is offline  
Old 06-20-2003, 10:47 AM THREAD STARTER               #3 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
thanks anyone got any other suggestions?
adam_uk is offline  
Old 06-20-2003, 11:01 AM   #4 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



What are you using as the upload script, PHP, perl, other?
deadserious is offline  
Old 06-20-2003, 11:03 AM THREAD STARTER               #5 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
Quote:
Originally posted by deadserious
What are you using as the upload script, PHP, perl, other?
php
adam_uk is offline  
Old 06-20-2003, 01:57 PM   #6 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



I think you can check for file types with PHP by doing something like this:

PHP Code:
if($HTTP_POST_FILES['file']['type'] != "image/gif") {
your code hereprobably some code to delete the file

????: NamePros.com http://www.namepros.com/web-design-discussion/14875-a-question-about-file-form-tag.html
file would be the name of the input field in the form.

More info here: http://us3.php.net/features.file-upload :beer:
deadserious is offline  
Old 06-20-2003, 02:59 PM THREAD STARTER               #7 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
cheers so ill see if its the thing hes after
adam_uk is offline  
Old 06-22-2003, 09:24 AM   #8 (permalink)
First Time Poster!
Join Date: Jun 2003
Posts: 1
carl359 is an unknown quantity at this point
 



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
carl359 is offline  
Old 06-22-2003, 09:17 PM   #9 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



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.
deadserious is offline  
Closed Thread


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


 
All times are GMT -7. The time now is 07:34 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger