|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
cfinput question
I'm using the <cfinput type="file"> tag to upload pdfs to the server.Les Irvin 07/01/09 04:03 P >I'm using the <cfinput type="file"> tag to upload pdfs to the server.sam Detweiler 07/01/09 04:33 P At the risk of exposing my ignorance, isn't cffile a server-sideLes Irvin 07/01/09 04:54 P > At the risk of exposing my ignorance, isn't cffile aJustin Scott 07/01/09 04:57 P Only Flash based uploaders can filter the user's choice of file types.Charlie Griefer 07/01/09 04:58 P >At the risk of exposing my ignorance, isn't cffile a server-sidesam Detweiler 07/01/09 05:08 P Les Irvin wrote:Ian Skinner 07/01/09 05:01 P Believe it or not, browsers are supposed too be able to do this. AccordingPaul Alkema 07/01/09 05:12 P 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 >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 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"> > 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 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 ----- >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 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. 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.
|
March 22, 2010
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||