Skip to main content
Participant
May 27, 2009
Question

cfftp not recognizing c:/

  • May 27, 2009
  • 4 replies
  • 707 views

This problem has been stumping me now for a week.

The issue:
I created an upload form on my website, and when i run it on my localhost, I can take my file from c:/mouse.jpg and put it on my FTP site through the below script. But when i run my script on my website which is hosted by GoDaddy it is not recognizing the filepath of C:/mouse.jpg . I get the error : Security: The requested template has been denied access to c:\mouse.jpg.

Godaddy says they aren't blocking any of the commands i am using. http://help.godaddy.com/article/547?

Why can it not recognize my harddrive path?

I know it is connecting to my server correctly because i can execute action = "LISTDIR" on both my localhost and the hosted site.

This has halted my progress of building my website severely! If someone can help me i would be so happy!


<p>Open a connection
<cfftp connection = "myConnection"
username = "myUsername"
password = "myPassword"
server = "ftp.richerconsulting.com"
action = "open"
stopOnError = "Yes"
passive="yes">

<p>Move Image File to Remote Server:<br></p>
<cfftp
connection = "myConnection"
action = "putFile"
name = "uploadFile"
transferMode = "binary"
localFile = "c:/mouse.jpg"
remoteFile = "test/mouse.jpg"
passive="yes"
>
<p>Did MOUSE succeed? <cfoutput>#cfftp.succeeded#</cfoutput>

<p>Close the connection:
<cfftp connection = "myConnection"
action = "close"
stopOnError = "Yes">
<p>Did it succeed? <cfoutput>#cfftp.succeeded#</cfoutput>

    This topic has been closed for replies.

    4 replies

    Participant
    May 28, 2009

    The problem was when you have a shared hosting account (as i do) you need to write to a local drive at GoDaddy.

    The correct path is:

         <cffile action = "upload"
            fileField = "FileContents"
            destination="D:\Hosting\AlbertRicher" <!--- This is where your destination is! --->
            accept = "image/jpeg, image/pjpeg"
             nameConflict = "MakeUnique">

    Participant
    May 27, 2009

    I found out that since this is a shared hosting account, that i can not have access directly to my hardrive from the site.

    Is there a workaround that anyone knows for this?

    I want to be able to create an upload form eventually on my shared hosting account.

    Inspiring
    May 27, 2009

    Ask godaddy how they handle ftp and find out what file path you can use.  Then, in your code, add some if/else logic to determine the correct path based on whether or not you are on godaddy or your local machine.

    Inspiring
    May 27, 2009

    Is there a file called mouse.jpg on the c drive of the godaddy computer?  Probably not.

    Inspiring
    May 27, 2009

    Does the account that the ColdFusion service is running under have rights to access to the C:/mouse.jpg file?