House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

cfinput question

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Les Irvin
07/01/2009 04:03 PM

I'm using the <cfinput type="file"> tag to upload pdfs to the server. Is there a way in Cold Fusion to, when the file upload / browse dialog comes up, restrict it to only show pdf files?  Or is that an operating system / java / something else function? Thanks in advance, Les

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
sam Detweiler
07/01/2009 04:33 PM

>I'm using the <cfinput type="file"> tag to upload pdfs to the server. >Is there a way in Cold Fusion to, when the file upload / browse dialog >comes up, restrict it to only show pdf files?  Or is that an operating >system / java / something else function? > >Thanks in advance, >Les how about <cffile action="upload" accept = "application/pdf"> rather than cfinput.. its what I use in my code sam

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Les Irvin
07/01/2009 04:54 PM

At the risk of exposing my ignorance, isn't cffile a server-side operation?  I'm needing a client side filter, basically. > how about <cffile action="upload" accept = "application/pdf">

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Justin Scott
07/01/2009 04:57 PM

> At the risk of exposing my ignorance, isn't cffile a > server-side operation?  I'm needing a client side > filter, basically. Yes.  There is no way that I am aware of to put a filter on the file selector box triggered by an input tag. -Justin

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Charlie Griefer
07/01/2009 04:58 PM

Only Flash based uploaders can filter the user's choice of file types. Best you can do is check it after the upload. (AFAIK) :) ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
sam Detweiler
07/01/2009 05:08 PM

>At the risk of exposing my ignorance, isn't cffile a server-side >operation?  I'm needing a client side filter, basically. > > >> how about <cffile action="upload" accept = "application/pdf"> using this the browser will ask for *.pdf files INITIALLY.. there is NO way to enforce ONLY a certain file extension/type.. (unless as noted you have code running a the client side (flash, plugin, etc).. You didn't ask for enforcement, you asked for 'show'.. Sam

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Ian Skinner
07/01/2009 05:01 PM

Les Irvin wrote: ----- Excess quoted text cut - see Original Post for more ----- Yup that is an operating system/ Java / Something else function.   Browsers do not support this type of functionality.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Paul Alkema
07/01/2009 05:12 PM

Believe it or not, browsers are supposed too be able to do this. According to W3C the input attribute "accept" should be able to be applied which would filter out results. Unfortunately most browsers don't follow this feature. I think Opera is the only one that actually does this. Which is very unlike Opera. See http://www.w3.org/TR/html401/interact/forms.html - 17.4 The INPUT element You should be able to do this... <cfinput name="uploadAFile" type="file" accept="application/pdf"> Les Irvin wrote: ----- Excess quoted text cut - see Original Post for more ----- Yup that is an operating system/ Java / Something else function.   Browsers do not support this type of functionality.


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

March 22, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31