<form action="something.cfm" method="post" enctype="multipart/form-data"
name="uploadForm" OnSubmit="return allowedExt(this.filefield.value);">
this is the form heading.
----- Original Message -----
From: "Bryan LaPlante" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, April 17, 2001 10:44 AM
Subject: Re: input type='file'
> I have a question about your script. Assuming the input looks like so
> <form name="foo">
> <input type="file" name="bar">
> </form>
> does your script refer to the input as document.foo.bar.value;
> If so how did you work around the access denied js error that the browser
> gives me when I try this?
>
> ----- Original Message -----
> From: "Michael Lugassy" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Tuesday, April 17, 2001 4:25 AM
> Subject: Re: input type='file'
>
>
> > I had the same problem, it's ain't possible.
> > What I used is to open a window indicating
> > only .jpeg or .gif is allowed and then used a javascript
> > to check what file was inserted in the formfield (before
> > uploading, not after): take a look:
> >
> > <script>
> > extensions = new Array(".JPG",".GIF",".gif",".jpg")
> > function allowedExt(fileType){
> > var extension = fileType.substring(fileType.length-4, fileType.length)
> > for (var i = 0; i < extensions.length; i++) {
> > if (extension == extensions[i]) {
> > return true
> > break
> > }
> > }alert(errorMsg()); return false
> > }
> >
> > function errorMsg(){
> > alertTxt = "Please select one of the following file types: \n\r"
> > for (var i = 2; i < extensions.length; i++){
> > alertTxt += extensions[i] + " "
> > {
> > }
> > }return alertTxt
> > }
> >
> >
> > Hope this helps.
> >
> > Bye.
> >
> > Michael Lugassy
> > Interactive Music Ltd.
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists