Skip to main content
November 17, 2009
Question

Need Help on cffile upload, destination to another server UNC Path

  • November 17, 2009
  • 2 replies
  • 1658 views

Anyone know why get this error?

The value of the attribute destination, which is currently ...\\Dev-server\Application\test\UploadFile\CompanyLogo\, is invalid.

i am using windows server 2003 as my OS,


The setup of my server is as below : -


I'm trying to use cffile to upload a file where by the destination i declare is located at another server which is my file server.


<cfset dlrPayInq_w = "\\Dev-server\Application\test\UploadFile\CompanyLogo\">


<cfif trim(fileName) NEQ "">
     <cfif directoryexists(dlrPayInq_w)>
<cfelse>
    <!--- Create this folder --->
    <cfdirectory action = "create"
    directory = "#dlrPayInq_w#">
</cfif>


<cffile action="UPLOAD" filefield="fileName" destination="#dlrPayInq_w#" nameconflict="overwrite">

i had change the login for the coldfusion service as 1 of the user that having the full access control to this share folder.

Any expert can help? Thanks for advanced.

    This topic has been closed for replies.

    2 replies

    Inspiring
    November 19, 2009

    <cfset dlrPayInq_w = "\\Dev-server\Application\test\UploadFile\CompanyLogo\">


    <cfif trim(fileName) NEQ "">
         <cfif directoryexists(dlrPayInq_w)>
    <cfelse>
        <!--- Create this folder --->
        <cfdirectory action = "create"
        directory = "#dlrPayInq_w#">
    </cfif>


    <cffile action="UPLOAD" filefield="fileName" destination="#dlrPayInq_w#" nameconflict="overwrite">

    That can't be the code you're running, because there's a dangling <cfif> in there (the directoryExists() one).  You'd just get a compile error with that.

    What's the actual code you're running?

    Can you do a simple read & write with <cffile> to that dir?

    --

    Adam

    November 19, 2009

    of coz this is not my full code, i just highlight those that are related.

    <cfif trim(fileName) NEQ "">
         <cfif directoryexists(dlrPayInq_w)>
    <cfelse>
        <!--- Create this folder --->
        <cfdirectory action = "create"
        directory = "#dlrPayInq_w#">
    </cfif>

    </cfif>

    there is another /cfif tag that miss out.

    Inspiring
    November 17, 2009
    i had change the login for the coldfusion service as 1 of the user that having the full access control to this share folder.

    Had you restarted your CF service after changing the login credentials??

    November 19, 2009

    I restarted for dunno how many times already, i tried reboot too.

    Inspiring
    November 19, 2009

    Have you logged in as the user CF is using. and tried to access that dir yourself?  Just to make sure the permissions are right?  Forget just eyeballing the settings and going "yeah, that looks right": test it.

    --

    Adam