Skip to main content
August 27, 2009
Question

Need Help on cffile upload, destination to another server

  • August 27, 2009
  • 3 replies
  • 2393 views

Anyone know why get this error? The specified directory attribute value Z:\Project_X\UploadFile\DlrPayInq\ could not be created.

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.

i had create a mapping from my application server to the file server as Z:.

<cfset dlrPayInq_w = "Z:\Project_X\UploadFile\DlrPayInq\">

<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 grant the folder permision to User type USER with Full Control, i can login as a normal window user and create files at  Z:\Project_X\UploadFile\DlrPayInq\ manually.

But when i try to upload file using cffile in my program, i hit this error The specified directory attribute value Z:\Project_X\UploadFile\DlrPayInq\ could not be created. Actually the folder DlrPayInq is already exist in that fileserver, how come CF trying to create again?

I try to remove this code

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

and i get another error, CFFILE atttribute error.

Any expert can help? Thanks for advanced.

    This topic has been closed for replies.

    3 replies

    September 1, 2009

    I had tried try login the ColdFusion Application Services as Administrator, and i removed the previous network mapping drive and recreate a new Mapping Drive by login window user as Administrator. The problem is still the same.

    ilssac
    Inspiring
    September 1, 2009

    Is that local Administrator account on the server a domain user?

    Usually one would not do that.  What most do is to to create a specific domain user for the ColdFusion server, we called ours 'cfappuser',  you then give that user the relevant permissions to the remote server and local server in order for the ColdFusion server to do what you want it to do.  Finally, you then configure the ColdFusion service to run as that user.

    ilssac
    Inspiring
    August 27, 2009

    To expand on tclaremont's reply.  "Z:" that you are using is a mapped drive and mapped drives are user specific.  So as well as making sure that ColdFusion is running as a user that has permissions to the remote server, you would have to log into the server using ColdFusions user account and create the mapped drive under that user.

    Most people don't bother with mapped drivers but rather use UNC path syntax.  Which would looks something like "\\MyRemoteServersName\Project_X\UploadFile\DirPayInq\"

    tclaremont
    Inspiring
    August 27, 2009

    ColdFusion is trying to create or update or upload that folder using the credentials used to START the ColdFusion service. It is not using YOUR credentials unless you happen to have the service set to run using your account.

    Go to the control panel, and then to services. Look at the ColdFusion service. What account is it running under? THAT is the account that needs permissions on your destination server.