Highlighted

Error uploading a file

Participant ,
Mar 01, 2016

Copy link to clipboard

Copied

I inherited an application a few years ago and up until today, a particular part of the code has worked flawlessly.   It was supposed to upload a pdf file and attach it to a record in the database.  Now, I receive a generic message and I have no clue what is wrong.  I mostly am an Oracle DBA and can do enough CF to get by, until now.   What can I add to this to help give me an idea of what is wrong?  Thanx.  In the below code piece, the cflocation line just goes on, but I can't do that here.

<cftry>

   <cffile action = "upload"  

             fileField = "requiredFILENAME"  

             destination = #newDest#     

             accept = "application/pdf">

<cfcatch>

   <CFLOCATION url="upload378.cfm?F378_ID=#FORM.F378_ID#&ERROR=We were unable to upload your file. Please try again..&FMBIC_DT=#FORM.FMBIC_DT#&IE_PMO_DT=#FORM.IE_PMO_DT#

                                 &IE_PMOMILCON_DT=#form.IE_PMOMILCON_DT#">

</cfcatch>

</cftry>


Adobe Community Professional
Correct answer by BKBK | Adobe Community Professional

I have reviewed this thread. It is now clear to me why Coldfusion is unable to find the destination directory.

When you began the thread, the value of the destination directory (newDest) was

\\TestServer\secure\Authorization\378Docs\

and the action page for the upload form was

\\TestServer\secure\Authorization\upload378Act.cfm

Destination directory and upload form appeared to have the same root directory, namely, \\TestServer\secure\Authorization\. However, in the most recent error-message, the value of the destination is

\\wedt-Dev\secure\Authorization\378Docs\

whereas the upload form's action page (which you have blanked out) is at

\\W...\...\...\WEDT\secure\Authorization\upload378Act.cfm

The respective root directories are different. This suggests that the paths \\wedt-Dev\secure\Authorization\ and \W...\...\...\WEDT\secure\Authorization\ belong to 2 different environments, possibly development and production. In fact, the latest error message suggests you're attempting to get the production code (in \WEDT\secure\Authorization\) to upload files to a destination on the development server (in \WEDT-DEV\secure\Authorization\).

Now, on to a possible solution. Use the following dynamic, server-independent definition of your destination directory

<cfset newDest = getDirectoryFromPath(expandpath('*.*')) & "378Docs\">

Place the line just before the cffile upload tag. It will resolve to

\\wedt-Dev\secure\Authorization\378Docs\

or to

\\W...\...\...\WEDT\secure\Authorization\378Docs\

depending on which server you are on.

Views

4.5K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Error uploading a file

Participant ,
Mar 01, 2016

Copy link to clipboard

Copied

I inherited an application a few years ago and up until today, a particular part of the code has worked flawlessly.   It was supposed to upload a pdf file and attach it to a record in the database.  Now, I receive a generic message and I have no clue what is wrong.  I mostly am an Oracle DBA and can do enough CF to get by, until now.   What can I add to this to help give me an idea of what is wrong?  Thanx.  In the below code piece, the cflocation line just goes on, but I can't do that here.

<cftry>

   <cffile action = "upload"  

             fileField = "requiredFILENAME"  

             destination = #newDest#     

             accept = "application/pdf">

<cfcatch>

   <CFLOCATION url="upload378.cfm?F378_ID=#FORM.F378_ID#&ERROR=We were unable to upload your file. Please try again..&FMBIC_DT=#FORM.FMBIC_DT#&IE_PMO_DT=#FORM.IE_PMO_DT#

                                 &IE_PMOMILCON_DT=#form.IE_PMOMILCON_DT#">

</cfcatch>

</cftry>


Adobe Community Professional
Correct answer by BKBK | Adobe Community Professional

I have reviewed this thread. It is now clear to me why Coldfusion is unable to find the destination directory.

When you began the thread, the value of the destination directory (newDest) was

\\TestServer\secure\Authorization\378Docs\

and the action page for the upload form was

\\TestServer\secure\Authorization\upload378Act.cfm

Destination directory and upload form appeared to have the same root directory, namely, \\TestServer\secure\Authorization\. However, in the most recent error-message, the value of the destination is

\\wedt-Dev\secure\Authorization\378Docs\

whereas the upload form's action page (which you have blanked out) is at

\\W...\...\...\WEDT\secure\Authorization\upload378Act.cfm

The respective root directories are different. This suggests that the paths \\wedt-Dev\secure\Authorization\ and \W...\...\...\WEDT\secure\Authorization\ belong to 2 different environments, possibly development and production. In fact, the latest error message suggests you're attempting to get the production code (in \WEDT\secure\Authorization\) to upload files to a destination on the development server (in \WEDT-DEV\secure\Authorization\).

Now, on to a possible solution. Use the following dynamic, server-independent definition of your destination directory

<cfset newDest = getDirectoryFromPath(expandpath('*.*')) & "378Docs\">

Place the line just before the cffile upload tag. It will resolve to

\\wedt-Dev\secure\Authorization\378Docs\

or to

\\W...\...\...\WEDT\secure\Authorization\378Docs\

depending on which server you are on.

Views

4.5K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 01, 2016 0
Advocate ,
Mar 01, 2016

Copy link to clipboard

Copied

To get more details, temporarily try the following:

<cftry>

  <cffile action = "upload" 

            fileField = "requiredFILENAME" 

            destination = #newDest#     

            accept = "application/pdf">

<cfcatch>

<!--- <CFLOCATION url="upload378.cfm?F378_ID=#FORM.F378_ID#&ERROR=We were unable to upload your file. Please try again..&FMBIC_DT=#FORM.FMBIC_DT#&IE_PMO_DT=#FORM.IE_PMO_DT#

                                &IE_PMOMILCON_DT=#form.IE_PMOMILCON_DT#"> --->

  <cfdump var="#cfcatch#">

  <cfabort showError="debugging">

</cfcatch>

</cftry>

I suspect you are getting a file collision.

Cheers

Eddie

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 01, 2016 0
Adobe Community Professional ,
Mar 01, 2016

Copy link to clipboard

Copied

Just


  <cffile action = "upload"  

             fileField = "requiredFILENAME"  

             destination = "#newDest#"     

             accept = "application/pdf">


and Coldfusion will tell you what the matter is.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 01, 2016 0
LEGEND ,
Mar 01, 2016

Copy link to clipboard

Copied

Is the file being inserted into the database?  Or does it reside on the web server and is somehow associated with a database record?

If the former, check the database table for unique constraints.  If the file (or even the file name) already exists in the database and the constraint for unique binary value or unique filename is set, that could cause an issue.

Also, in your CFTRY/CFCATCH, set it to either email you a CFDUMP of cfcatch, or display it right on the page as EddieLotter suggested (remembering, of course, to remove that part before going to production.)

HTH,

^_^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 01, 2016 0
Participant ,
Mar 17, 2016

Copy link to clipboard

Copied

The file is stored in a directory elsewhere on the server and a pointer to that file is stored in the database.

I put in the debugging statements and tried again.  I immediately got a 500 - Internal server error.  I commented out the debug statement and tried again...  yet another 500.   Not sure what I have done.   Here is the code fragment after I commented out the debug statement.

<cftry>

  <cffile action = "upload" 

            fileField = "requiredFILENAME" 

            destination = #newDest#     

            accept = "application/pdf">

<cfcatch>

<CFLOCATION url="upload378.cfm?F378_ID=#FORM.F378_ID#&ERROR=We were unable to upload your file. Please try again..&FMBIC_DT=#FORM.FMBIC_DT#&IE_PMO_DT=#FORM.IE_PMO_DT#

                                &IE_PMOMILCON_DT=#form.IE_PMOMILCON_DT#">

<!---  <cfdump var="#cfcatch#">

  <cfabort showError="debugging"> --->

</cfcatch>

</cftry>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 17, 2016 0
Advocate ,
Mar 17, 2016

Copy link to clipboard

Copied

LouieWarren wrote:

The file is stored in a directory elsewhere on the server and a pointer to that file is stored in the database.

If this is the process of uploading a file then surely there won't yet be a record in the database. Right?

Cheers

Eddie

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 17, 2016 0
Participant ,
Mar 17, 2016

Copy link to clipboard

Copied

I am assuming.  The error is on the Production machine and it is in control of the government DBAs...  I have a bunch of hoops to jump through to get a query run.  Sucks to be me, huh?   I'll have to submit the request.   Thank you.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 17, 2016 0
Adobe Community Professional ,
Mar 17, 2016

Copy link to clipboard

Copied

LouieWarren wrote:

The file is stored in a directory elsewhere on the server and a pointer to that file is stored in the database.

I put in the debugging statements and tried again.  I immediately got a 500 - Internal server error.  I commented out the debug statement and tried again...  yet another 500.   Not sure what I have done.   Here is the code fragment after I commented out the debug statement.

<cftry>

  <cffile action = "upload"

            fileField = "requiredFILENAME"

            destination = #newDest#    

            accept = "application/pdf">

<cfcatch>

<CFLOCATION url="upload378.cfm?F378_ID=#FORM.F378_ID#&ERROR=We were unable to upload your file. Please try again..&FMBIC_DT=#FORM.FMBIC_DT#&IE_PMO_DT=#FORM.IE_PMO_DT#

                                &IE_PMOMILCON_DT=#form.IE_PMOMILCON_DT#">

<!---  <cfdump var="#cfcatch#">

  <cfabort showError="debugging"> --->

</cfcatch>

</cftry>

What happens when you comment out the entire code, like this?

<!---

<cftry>

  <cffile action = "upload" 

            fileField = "requiredFILENAME" 

            destination = #newDest#     

            accept = "application/pdf">

<cfcatch>


<CFLOCATION url="upload378.cfm?F378_ID=#FORM.F378_ID#&ERROR=We
were unable to upload your file. Please try
again..&FMBIC_DT=#FORM.FMBIC_DT#&IE_PMO_DT=#FORM.IE_PMO_DT#

                                &IE_PMOMILCON_DT=#form.IE_PMOMILCON_DT#">

<cfdump var="#cfcatch#">

  <cfabort showError="debugging">

</cfcatch>

</cftry>

--->

<cfdump var="#form#">

Do you get the form fields? If so, which?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 17, 2016 0
Participant ,
Mar 18, 2016

Copy link to clipboard

Copied

500 Internal server error

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 18, 2016 0
Adobe Community Professional ,
Mar 18, 2016

Copy link to clipboard

Copied

Then something went wrong with the form submission. Could you share the form page with the forum?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 18, 2016 0
Participant ,
Mar 21, 2016

Copy link to clipboard

Copied

I am a CF novice.  I hope I've included the right part of the code.   Here's the entire calling .cfm file:

<HTML>

<HEAD>

<TITLE>Upload 378</TITLE>

<link rel=stylesheet href="REDProj.css">

</HEAD>

<BODY>

<!--- <CFOUTPUT>#CGI.QUERY_STRING#</CFOUTPUT> --->

    <CFOUTPUT>

        <CFSET newDest = #authfileroot#&"378Docs\">

    </CFOUTPUT>

   

    <CFQUERY datasource="#datasource#" name="Getdata">

        select FileLink from  FM_FORM378_TRAN

        where F378_ID=#FORM.F378_ID#

    </CFQUERY>

    <cfoutput>

    <cfset oldfile=#newDest#&#Getdata.FileLink#>

    </cfoutput>

    <cfif #Getdata.FileLink# neq ''>

        <cfif fileexists("#oldfile#")>

            <cftry>

            <cffile action = "delete" file=#oldfile#>

            <cfcatch>

<!---            <CFLOCATION url="upload378.cfm?F378_ID=#FORM.F378_ID#&ERROR=We were unable to delete your old file. Please try again..&FMBIC_DT=#FORM.FMBIC_DT#&IE_PMO_DT=#FORM.IE_PMO_DT#&IE_PMOMILCON_DT=#form.IE_PMOMILCON_DT#"> -->

                <cfdump var="#cfcatch#">

                <cfabort showError="debugging">

            </cfcatch>

            </cftry>

        </cfif>

    </cfif>

<CFIF IsDefined("URL.Action") AND URL.Action is "Upload">

    <CFSET F378_ID = #FORM.F378_ID#>

    <CFSET IE_PMO_DT = #FORM.IE_PMO_DT#>

    <CFSET FMBIC_DT = #FORM.FMBIC_DT#>

    <CFSET FILENAME = #FORM.requiredFILENAME#>

    <CFSET IE_PMOMILCON_DT = #FORM.IE_PMOMILCON_DT#>

    <CFIF variables.FILENAME is "">

        <CFLOCATION url="upload378.cfm?F378_ID=#FORM.F378_ID#&ERROR=You must select a file.&FMBIC_DT=#FORM.FMBIC_DT#&IE_PMO_DT=#FORM.IE_PMO_DT#&IE_PMOMILCON_DT=#form.IE_PMOMILCON_DT#">

    </CFIF>

<!--- <cftry>

  <cffile action = "upload" 

            fileField = "requiredFILENAME" 

            destination = #newDest#     

            accept = "application/pdf">

<cfcatch>

<CFLOCATION url="upload378.cfm?F378_ID=#FORM.F378_ID#&ERROR=We were unable to upload your file. Please try again..&FMBIC_DT=#FORM.FMBIC_DT#&IE_PMO_DT=#FORM.IE_PMO_DT#

                                &IE_PMOMILCON_DT=#form.IE_PMOMILCON_DT#">

  <cfdump var="#cfcatch#">

  <cfabort showError="debugging">

</cfcatch>

</cftry>  --->

<cfdump var="#form#">

   

   

    <CFOUTPUT><CFSET oldName = #newDest# & #CFFILE.ServerFile#></CFOUTPUT>

    <CFOUTPUT><CFSET newName = #newDest# & #variables.F378_ID# &"_"& #CFFILE.ServerFile#></CFOUTPUT>

    <cftry>

        <CFFILE ACTION="Rename"

           SOURCE=#oldName#

           DESTINATION=#newName#>

    <cfcatch>

        <CFLOCATION url="upload378.cfm?F378_ID=#FORM.F378_ID#&ERROR=We were unable to rename your file. Please try again..&FMBIC_DT=#FORM.FMBIC_DT#&IE_PMO_DT=#FORM.IE_PMO_DT#&IE_PMOMILCON_DT=#form.IE_PMOMILCON_DT#">

    </cfcatch>

    </cftry>

   

    <CFQUERY datasource="#datasource#" name="add378">

        update FM_FORM378_TRAN

        set  IE_PMO_DT=to_date('#FORM.IE_PMO_DT#','mm/dd/yyyy') ,

        FMBIC_DT=to_date('#FORM.FMBIC_DT#','mm/dd/yyyy'),

        IE_PMOMILCON_DT=to_date('#FORM.IE_PMOMILCON_DT#','mm/dd/yyyy'),

        FileLink=#FORM.F378_ID# ||'_'|| '#CFFILE.ServerFile#'

        where F378_ID=#FORM.F378_ID#

    </CFQUERY>

   

    <script language=javascript type='text/javascript'>

        //opener.window.location=opener.window.location;

        opener.window.location.reload();

        self.close();

        //return false;

    </SCRIPT>

<CFELSE>

    How did you get here!!!

    <script language=javascript type='text/javascript'>

        self.close();

    </SCRIPT>

</CFIF>

</BODY>

</HTML>

Hopefully that shows what you need.  Sorry to be dense.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 21, 2016 0
Adobe Community Professional ,
Mar 21, 2016

Copy link to clipboard

Copied

That was the action page. I requested the form page.

In any case, you could do with fewer <cfoutput> tags and fewer # symbols:

<HTML>

<HEAD>

<TITLE>Upload 378</TITLE>

<link rel=stylesheet href="REDProj.css">

</HEAD>

<BODY>

<!--- <CFOUTPUT>#CGI.QUERY_STRING#</CFOUTPUT> --->

  

<CFSET newDest = authfileroot & "378Docs\">

  

  

    <CFQUERY datasource="#datasource#" name="Getdata">

    select FileLink from  FM_FORM378_TRAN

    where F378_ID=#FORM.F378_ID#

    </CFQUERY>

<cfset oldfile=newDest & Getdata.FileLink>

<cfif Getdata.FileLink neq ''>

    <cfif fileexists("#oldfile#")>

        <cftry>

        <cffile action = "delete" file="#oldfile#">

        <cfcatch>

<CFLOCATION url="upload378.cfm?F378_ID=#FORM.F378_ID#&ERROR=We were unable to delete your old file. Please try again..&FMBIC_DT=#FORM.FMBIC_DT#&IE_PMO_DT=#FORM.IE_PMO_DT#&IE_PMOMILCON_DT=#form.IE_PMOM ILCON_DT#"> -->

            <cfdump var="#cfcatch#">

            <cfabort showError="debugging">

            </cfcatch>

        </cftry>

    </cfif>

</cfif>

<CFIF IsDefined("URL.Action") AND URL.Action is "Upload">

<CFSET F378_ID = FORM.F378_ID>

<CFSET IE_PMO_DT = FORM.IE_PMO_DT>

<CFSET FMBIC_DT = FORM.FMBIC_DT>

<CFSET FILENAME = FORM.requiredFILENAME>

<CFSET IE_PMOMILCON_DT = FORM.IE_PMOMILCON_DT>

<CFIF variables.FILENAME is "">

    <CFLOCATION url="upload378.cfm?F378_ID=#FORM.F378_ID#&ERROR=You must select a file.&FMBIC_DT=#FORM.FMBIC_DT#&IE_PMO_DT=#FORM.IE_PMO_DT#&IE_PMOMILCON_DT=#form.IE_PMOMIL CON_DT#">

</CFIF>

<cftry>

  <cffile action = "upload"

        fileField = "requiredFILENAME"

        destination = "#newDest#"   

        accept = "application/pdf">

<cfcatch>

<CFLOCATION url="upload378.cfm?F378_ID=#FORM.F378_ID#&ERROR=We were unable to upload your file. Please try again..&FMBIC_DT=#FORM.FMBIC_DT#&IE_PMO_DT=#FORM.IE_PMO_DT#

                                &IE_PMOMILCON_DT=#form.IE_PMOMILCON_DT#">

  <cfdump var="#cfcatch#">

  <cfabort showError="debugging">

</cfcatch>

</cftry>

<cfdump var="#form#">

  

  

<CFSET oldName = newDest & CFFILE.ServerFile>

<CFSET newName = newDest & variables.F378_ID & "_" & CFFILE.ServerFile>

<cftry>

    <CFFILE ACTION="Rename"

       SOURCE="#oldName#"

       DESTINATION="#newName#">

<cfcatch>

    <CFLOCATION url="upload378.cfm?F378_ID=#FORM.F378_ID#&ERROR=We were unable to rename your file. Please try again..&FMBIC_DT=#FORM.FMBIC_DT#&IE_PMO_DT=#FORM.IE_PMO_DT#&IE_PMOMILCON_DT=#form.IE_PMOM ILCON_DT#">

</cfcatch>

</cftry>

  

    <CFQUERY datasource="#datasource#" name="add378">

    update FM_FORM378_TRAN

    set  IE_PMO_DT=to_date('#FORM.IE_PMO_DT#','mm/dd/yyyy') ,

    FMBIC_DT=to_date('#FORM.FMBIC_DT#','mm/dd/yyyy'),

    IE_PMOMILCON_DT=to_date('#FORM.IE_PMOMILCON_DT#','mm/dd/yyyy'),

    FileLink=#FORM.F378_ID# ||'_'|| '#CFFILE.ServerFile#'

    where F378_ID=#FORM.F378_ID#

</CFQUERY>

  

    <script language=javascript type='text/javascript'>

    //opener.window.location=opener.window.location;

    opener.window.location.reload();

    self.close();

    //return false;

</SCRIPT>

<CFELSE>

How did you get here!!!

<script language=javascript type='text/javascript'>

    self.close();

</SCRIPT>

</CFIF>

</BODY>

</HTML>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 21, 2016 1
Explorer ,
Mar 22, 2016

Copy link to clipboard

Copied

As I said earlier, I'm a novice with very little CF experience.   I'm normally an Oracle DBA and was thrown into this because the customer thought that is what they needed.  In actuality, they needed a CF developer with a little Oracle experience as opposed to the opposite.    That said, you are talking about the pop-up form to select the file to upload?  What tag would that have?   Once again, sorry to be dense.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 22, 2016 0
Participant ,
Apr 13, 2016

Copy link to clipboard

Copied

This?

<FORM method="post" action="upload378Act.cfm?Action=Upload" onSubmit="return checkform(this)" enctype="multipart/form-data">

<TABLE width="100%">

    <tr>

        <td align=center valign="top" colspan="3">

            <FONT style="FONT: bold 12pt Arial; color: darkblue;">

                Upload 378

            </FONT>

            <BR>

            <CFIF IsDefined("URL.ERROR")>

                <FONT style="FONT: bold 8pt Arial; color: red;">

                <CFOUTPUT>#URL.ERROR#</CFOUTPUT>

                </FONT>

            </CFIF>

            <INPUT type="hidden" name="F378_ID" value="<CFOUTPUT>#URL.F378_ID#</CFOUTPUT>">

        </td>

    </tr>

    <tr>

        <td>

        <cfif #getdata.budgetprogramID# is 120 or #getdata.budgetprogramID# is 110>

            <b>SAF/IEI PMO MILCON Date</b>

        </cfif>

        </td>

        <td><b>SAF/IEI PMO Appr Date</b></td>

        <td><b>SAF/FM Coord Date</b></td>

    </tr>

    <tr>

        <CFOUTPUT>

        <td>

        <cfif #getdata.budgetprogramID# is 120 or #getdata.budgetprogramID# is 110>

        <INPUT type="text" name="IE_PMOMILCON_DT" size="15" <CFIF IsDefined("URL.IE_PMOMILCON_DT")> value="#URL.IE_PMOMILCON_DT#"</CFIF> readonly>

        <A HREF="2"

           onClick="cal.select(document.forms[0].IE_PMOMILCON_DT,'anchor2','MM/dd/yyyy'); return false;"

         NAME="anchor2" ID="anchor2">

        <img alt="Select a date" height=16 width=21 src="../../Images/pdate.gif" border=0>

        </A>

        <cfelse>

            <INPUT name="IE_PMOMILCON_DT" type="hidden" <CFIF IsDefined("URL.IE_PMOMILCON_DT")> value="#URL.IE_PMOMILCON_DT#"</CFIF>>

        </cfif>

        </td>

        <td><INPUT type="text" name="IE_PMO_DT" size="15" <CFIF IsDefined("URL.IE_PMO_DT")> value="#URL.IE_PMO_DT#"</CFIF> readonly>

        <A HREF="1"

           onClick="cal.select(document.forms[0].IE_PMO_DT,'anchor1','MM/dd/yyyy'); return false;"

         NAME="anchor1" ID="anchor1">

        <img alt="Select a date" height=16 width=21 src="../../Images/pdate.gif" border=0>

        </A>

        </td>

      

        <td><INPUT type="text" name="FMBIC_DT" size="15" <CFIF IsDefined("URL.FMBIC_DT")> value="#URL.FMBIC_DT#"</CFIF> readonly>

        <A HREF="3"

           onClick="cal.select(document.forms[0].FMBIC_DT,'anchor3','MM/dd/yyyy'); return false;"

         NAME="anchor3" ID="anchor3">

        <img alt="Select a date" height=16 width=21 src="../../Images/pdate.gif" border=0>

        </A>

        </td>

        </CFOUTPUT>

    </tr>

    <tr>

        <td colspan="3">

            <b>Select File and Upload</b><BR>

            <input type="file" name="requiredFILENAME" size="50"><BR>

            *Only file type accepted: *.pdf

        </td>

    </tr>

    <tr>

        <td colspan="3" align="right">

            <input type="submit" value="Save" style="BACKGROUND-COLOR:#ffffcc;FONT: bold 8pt Arial;COLOR: #000080;BORDER-LEFT: 0px; BORDER-TOP:0px; width:100px; height:18px">

        </td>

    </tr>

</TABLE>

</FORM>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 13, 2016 0
Participant ,
May 16, 2016

Copy link to clipboard

Copied

I've been sidetracked with that other issue we worked through.   Did I give the code snippet you needed?

The customer sent an e-mail this morning stating that she remembered this issue happening before and that the solution or workaround was the filename could not contain special characters.   I don't think that is it, but at this point, since I don't really know what I'm doing, I'm willing to try anything.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 16, 2016 0
Advocate ,
May 16, 2016

Copy link to clipboard

Copied

Yes, you provided the relevant snippets.

Can you reproduce the problem yourself or are you relying on the customer to do the testing?

Cheers

Eddie

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 16, 2016 0
Participant ,
May 17, 2016

Copy link to clipboard

Copied

I do all the testing.  The customer, being impatient, constantly tries to upload, I am assuming, thinking that time will solve the issue, or that I fixed it and didn't tell her.   She just recently sent the e-mail that said, previously, the filename was including the entire path of where the file resided, which caused problems.  That was in 2012, and the programmer at the time, fixed it.  The customer has no clue.  I liken their knowledge of the app and how it works to the old custom of bleeding the patient to get out the bad blood.

All that aside, in my testing, it still fails to upload.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 17, 2016 0
Advocate ,
May 17, 2016

Copy link to clipboard

Copied

Okay, since you can reproduce the problem we may have something to work with.

Look at my first response to your original post. I removed the redirect you are using to handle errors and added code to display the exception details. Please use that code and post the text of the exception for us to have a look at.

Cheers

Eddie

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 17, 2016 0
Participant ,
May 17, 2016

Copy link to clipboard

Copied

I think I put it in the right place:

<CFIF IsDefined("URL.Action") AND URL.Action is "Upload">

    <CFSET F378_ID = #FORM.F378_ID#/>

    <CFSET IE_PMO_DT = #FORM.IE_PMO_DT#/>

    <CFSET FMBIC_DT = #FORM.FMBIC_DT#/>

    <CFSET FILENAME = #FORM.requiredFILENAME#/>

    <CFSET IE_PMOMILCON_DT = #FORM.IE_PMOMILCON_DT#/>

   <cftry>

      <cffile action = "upload"  

                fileField = "requiredFILENAME"  

                destination = #newDest#      

                accept = "application/pdf">

    <cfcatch>

    <!---    <CFIF variables.FILENAME is "">

        <CFLOCATION url="upload378.cfm?F378_ID=#FORM.F378_ID#&ERROR=You must select a file.&FMBIC_DT=#FORM.FMBIC_DT#&IE_PMO_DT=#FORM.IE_PMO_DT#&IE_PMOMILCON_DT=#form.IE_PMOMILCON_DT#">

    </CFIF> --->

      <cfdump var="#cfcatch#">

      <cfabort showError="debugging">

    </cfcatch>

    </cftry>  <cfdump var="#form#">

  

The error message now tells me the path, where the uploaded file is stored, isn't valid.  It exists.

The value of the attribute destination, which is currently \xxxxxx\secure\Authorization\378Docs\, is invalid.

Do you need to see the whole error page? 

Sorry for the crappy formatting.  I still haven't figured out how to format the code with the line numbers.  I did once, but can't seem to do it again.

Thank you.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 17, 2016 0
Advocate ,
May 17, 2016

Copy link to clipboard

Copied

To format code, click on the "Use advanced editor" link at the top, right of the input box, highlight the text to format, then click the >> button in the toolbar.

Does the value of newDest contain a drive letter or is it a UNC path?

Cheers

Eddie

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 17, 2016 0
Participant ,
May 17, 2016

Copy link to clipboard

Copied

UNC  - \xxxxxx\secure\Authorization\378Docs\

The \xxxxxx is the root where the code resides and the directory to store the uploaded file.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 17, 2016 0
Advocate ,
May 17, 2016

Copy link to clipboard

Copied

Remember that when the server reports that it cannot access a location, it is the user account that the CF process is using that might have problems accessing an existing location.

As a debugging step, try adding the following code to verify that the server can see a file that you know exists:

<cfif fileExists(newDest & 'filename.ext')>

  The file is visible to the server.

<cfelse>

  The file is not visible to the server.

</cfif>

Cheers

Eddie

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 17, 2016 0
Participant ,
May 17, 2016

Copy link to clipboard

Copied

I plugged it in before and after the debug code and no change.  I'm sure I didn't do it correctly.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 17, 2016 0
Advocate ,
May 17, 2016

Copy link to clipboard

Copied

When you say "no change" do you mean you are not seeing either of the "The file is..." messages displayed on the Web page?

Create a new, temporary page with the test code I recently posted.

Cheers

Eddie

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 17, 2016 0
Participant ,
May 17, 2016

Copy link to clipboard

Copied

I deleted everything but the test code and got the message The file is not visible to the server.  I put the original file back and the same message came up.  I missed it in  the original error page.  The variable newDest is assigned earlier in the page:

<CFOUTPUT>
   <CFSET newDest = #authfileroot#&"378Docs\"/>

    </CFOUTPUT>

Which gives the correct location displayed in the error message.  What am I not understanding?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 17, 2016 0
Advocate ,
May 17, 2016

Copy link to clipboard

Copied

It's time to get your network administrator involved. And the server administrator if they are not the same person.

If ColdFusion cannot access a file, that you know to exist, then the user account that the ColdFusion service is using, doesn't have the necessary security privileges to access that folder. Only your administrator(s) can sort out security problems.

Cheers

Eddie

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 17, 2016 0
Participant ,
May 18, 2016

Copy link to clipboard

Copied

I've had the SysAdmin involved and he ensures me (with screen shots) that everything is correct and that it is my problem.  I had another error with this app, earlier, where it was trying to produce a report (an Excel spreadsheet) and it threw the error message, "access denied".  I was able to go to the directory in FTP and change the permissions to 777 and it worked.  I will attempt that with this, but I don't see how it would change the not found issue. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 18, 2016 0
Advocate ,
May 18, 2016

Copy link to clipboard

Copied

It occurs to me that you said it is a UNC path, but you aren't showing the initial double-backslash in your posts. You are using one in your code, right?

For example: \\MachineName\folder\subfolder\file.ext

Cheers

Eddie

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 18, 2016 0
Participant ,
May 19, 2016

Copy link to clipboard

Copied

Ok, it's highly likely I misunderstood UNC...

The directory is assigned in Application.cfc

<cfset authfileroot="\xxxxxxxx\secure\Authorization\">

In the .cfm I am working with, the storage location of the uploaded file is assigned as such:

<CFOUTPUT>

   <CFSET newDest = #authfileroot#&"378Docs\"/>

</CFOUTPUT>

I hope that answers your question.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 19, 2016 0
Advocate ,
May 19, 2016

Copy link to clipboard

Copied

Yes, that makes more sense.

You are not specifying which drive the folder is on.

Is it a local hard drive on the server or is it a network share?

If it is a local hard drive, then add the drive letter (like C: or D:) however, if it is a network share, then use a UNC path, which your SysAdmin can give you.

Cheers

Eddie

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 19, 2016 0
Explorer ,
May 17, 2016

Copy link to clipboard

Copied

Just a thought, what if you added enctype="multipart/form-data" to the form?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 17, 2016 0
Advocate ,
May 17, 2016

Copy link to clipboard

Copied

Good thought, but he already has that.

Cheers

Eddie

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 17, 2016 0
Explorer ,
May 17, 2016

Copy link to clipboard

Copied

Hmm, OK.  I searched this page and didn't see it.

That's all I had to offer, good luck. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 17, 2016 0
Most Valuable Participant ,
Jul 18, 2016

Copy link to clipboard

Copied

Louie,

You are correct.  I think I had this confused with another thread (maybe not even one from you) that kept changing topic.  Nevermind.

-Carl V. - Moderator

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 18, 2016 0
Participant ,
Jul 19, 2016

Copy link to clipboard

Copied

I think my post from July 1 is where things went astray.   While it's the same application, it has nothing to do with the original error.  As I said earlier, I tend to react to errors I have and not think it through whether it fits in the thread or not.  I will do my best to not do that any more on here.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 19, 2016 0