Skip to main content
Inspiring
June 15, 2009
Question

uploading to a different server via CFFILE?

  • June 15, 2009
  • 2 replies
  • 935 views

I have an application that allows uploading of files to a folder on our CF server. I have now been asked to no longer allow file uploads to that server, but instead send them to a file server that does not have ColdFusion. The file server is mapped in "my computer" (it's the I: drive). We are running windows.

Can I upload to a different location?


I tried settting DESTINATION="I:" but it does not work.

    This topic has been closed for replies.

    2 replies

    Inspiring
    June 15, 2009

    When you define any Windows service, one of the "properties" of that service is the definition of the account that it is to log-on as.

    (See:  Administrative Tools .. Services.  Choose a service, right click, choose Properties.  From the pop-up, choose the Log On tab.  Your Windows version may vary.)

    By default, services tend to log on as the "Local System account," which probably isn't what you want, I think, for something like CF.  Not if it has the ability to interact with local files, e.g. uploading and downloading.  It is far better in my opinion for you to define a local account ... one that is not capable of being "logged on" to ... whose only purpose is for it to be used by the CF Server.  This will allow you to build a definite boundary around what the CF Server can do, and it will also let you easily identify the files that are created by the server.  The so-called "principle of least privilege" is a good bright-line rule to follow, and when CF is being used to manipulate files (locally and/or elsewhere), I think it's prudent to give CF its own explicit identity.

    Inspiring
    June 15, 2009

    You can use cffile to upload to any server to which you have the required permission.  I forget the exact syntax, but it's probably something like

    \\server name\drive\path\file name

    brasethAuthor
    Inspiring
    June 15, 2009

    I read where the server runs as user SYSTEM, and that has no network capabilities. So it looks like I would need to know how to switch the user CF is running under.