If I am totally wrong just ignore my suggestion:

It looks like you are trying to do some parsing of the uploaded
filename. I recently needed to perform similar processing and here is
what I did:
- I let the user upload the file using a file type html input
- my submit button called a _javascript_ function that pulled the filename
and set it into a hidden input field's value then submitted the form
- I then performed my filename processing on the cf template that was
the action target.
- In my cffile I used the changed name in my destination attribute

I hope this helps.

Doug

Brian Yager wrote:

>I am getting an error that the form field does not contain a file.  
>
>Here is the code from the first page
>
><form action="" method="post" enctype="multipart/form-data" name="form">
><input name="myfile" type="file" > ><input name="up_thefile" type="hidden" value="" id="up_thefile">
><input name="" type="submit">
></form>
>
><script>
>function parseFile1Name(theFile)
> {
>    var start = -1;
>    while (theFile.value.indexOf("\\", start + 1) != -1)
>    {
>       start = theFile.value.indexOf("\\", start + 1);
>    }
>    document.form.up_thefile.value = theFile.value.substring(start+1, theFile.value.length);
> }
>
></script>
>
>
>
>And here is the code from the second page
>
><cfquery name="get_param" datasource="#dsn#">select value from class_parameter where parameter = 'FILESERVER'</cfquery>
><cfoutput>
>form.thefile is #form.myfile# and #form.up_thefile#
><body>
><cffile action="" filefield="#form.myfile#" destination="#get_param.value#\testfile.doc" nameconflict="overwrite">
>
></cfoutput>
>
>
>I am getting a value for both form.myfile and form.up_thefile.  But I am getting
>"The form field C:\CFusionMX\runtime\servers\default\SERVER-INF\temp\wwwroot-tmp\neotmp60591.tmp did not conatin a file"
>
>I am using CFMX6.1 on a Windows 2000 Server with Oracle 9i.  Has anyone seen this before?
>
>Thank for the help.
>
>Brian Yager
>President - North Alabama
>Cold Fusion Users Group
>http://www.nacfug.com
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to