CFFILE tag reference to MS Excel is invalid.

I have recently taken over support for a ColdFusion website, and have migrated the site to a new server.  There are some webpages that allow the user to upload an MS Excel file using CFFILE tag,  in conjunction with CFLOOP and INSERT statements.  This MS Excel upload process now fails on the CFFILE tag.  The error message is:

"The destination "D:\Coldfusionsites\x.x\databases" specified in the CFFILE tag is invalid."

Can someone explain what CFFILE is trying to do, and I need to do to fix this?

Code below:

<cffile action="upload" filefield="fileupload" destination="D:\Coldfusionsites\x.x\databases" nameconflict="overwrite">

      <cfquery name="getExcel" datasource="ExcelData">
            SELECT col1,
            FROM [sheet1$]
            in 'D:\Coldfusionsites\x.x\databases\cor.xls'"Excel 8.0;IMEX=1;"
      <CFLOOP query="getExcel">
            <cfquery name="addrecords" datasource="#application.dsn#">
                  INSERT INTO tablename
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


i imagine the destination directory isnt valid on your new server.

The CFFILE tag is taking the file from the upload form and saving it to the server in the directory.


This error suggests that this directory does not exist. If you create it, it will most likely fix your problem.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dkbailey1Author Commented:
I now have the CFFILE tag working, but my SELECT statement does not recognize the path.  The path worked for CFFILE though.  Maybe it has something to do with the Excel and IMEX references at the end of the 'in' statement.

Any thoughts?  Thanks.

<cffile action="upload" filefield="fileupload"       destination="\\xxxx\yyy\process" nameconflict="overwrite">

<cfquery name="getExcel" datasource="ExcelData">
           SELECT       col1
           FROM [sheet1$]
           in '\\xxxx\yyy\COR.xls'"Excel 8.0;IMEX=1;"
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.