Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File type input - Filter files

Status
Not open for further replies.

i2k2

Programmer
Nov 9, 2002
5
0
0
AE
Hi all,
I'm using the FILE type input: <input type=&quot;file&quot;> and I want to filter the files so the users can browse only and only the JPEG files (*.jpg) ... Is this possible?
 
What language will handle the file on the server side?

I use ColdFusion and this will allow only certain file types if specified. You will need to do this on the server side as you can't forbid on the client side when browsing. You may be able to use javascript to check the value of the input onSubmit of the form. DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
Hi DeZiner,
Thanks for the reply. I use CFM as well. Could you write me a piece of code showing how to implement this idea?

--------
i2k2
 
<CFFILE ACTION=&quot;Upload&quot;
FILEFIELD=&quot;FileContents&quot;
DESTINATION=&quot;c:\web\uploads\&quot;
ACCEPT=&quot;text/html&quot;
NAMECONFLICT=&quot;MakeUnique&quot;
ACCEPT=&quot;image/gif, image/jpg&quot;>

Check the cfm and javascript forums. There are is a lot of info how to check client side rather than waiting till it hits the server. but this is a great fall back.
DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top