Skip to main content
Inspiring
October 27, 2009
Question

Using CFFTP, getting Error 553

  • October 27, 2009
  • 1 reply
  • 862 views

I want a user to be able to browse to a file on their local machine then FTP it to a remote server.I've been using CFFTP. I can make the connection to the server just fine. I have the path correct. I keep getting an Error 553, can't create the file. My web administrator says that he has the permissions set correctly. I don't know what else to do. I've been trying to make this work for over a month. Can someone give me a hand with this? I've tried 3 times to attach the cfm file which is 2k, but it says "content type of this attachement is not allowed." I'm pasting the code below. thanks.

<fieldset><legend>Upload a form to the server</legend>   
<!--- Create HTML form to upload a file --->
<cfform action="test_cfftp.cfm" enctype="multipart/form-data"method="post">

<!--- File field for user to select or specify a filename --->
<label for="fileName"><a href="" onmouseover="Tip('Search for the file to upload. i.e. EFO00001_mm-dd-yyyy.pdf')", onmouseout="UnTip()">File to upload</a></label>
<cfinput type="file" name="fileName" ><br>


<!--- Submit button to submit the form (and upload the file) --->
<cfinput type="submit" name="upload" class="mysubmit" value="Upload the File">
</cfform></fieldset>

<!--- Get the file name of this file. --->
<cfset strFilePath = "/taxweb/pubs" />

<!--- Set up the FTP configuration. --->
<cfset objFTPProperties = {
    Server = "xxxxxxxx",
    Port = "xx",
    Username = "xxxxxx",
    Password = "xxxxxxx"   
    } />

<!---upload the file--->
<cfftp
    action="open"
    connection="objConnection"
    attributeCollection="#objFTPProperties#"
    />
   <cfset strFilePath = "/taxweb/pubs">
    <cfoutput>at line 48 fileName = #fileName#  and strFilePath = #strFilePath#</cfoutput><br />
  <cfoutput>at line 49 strFilePath/fileName = #strFilePath##fileName#    form.fileName = #form.fileName#</cfoutput><br />

<cfftp
    action="putfile"
    connection="objConnection"
    localfile="#form.fileName#"
    remotefile="/pubs/#fileName#"
    transfermode="auto"
    timeout="300"
    />
<CFDUMP VAR=#cfftp#>

<!--- Close the connection. --->
<cfftp
    action="close"
    connection="objConnection"
    />

    This topic has been closed for replies.

    1 reply

    Inspiring
    October 27, 2009

    CFFTP is for FTPing files from the ColdFusion server to/from an FTP server.  It's got nothing to do with client operations.

    You need to upload the file to the CF server first (via a form and a <cffile action="uplaod">), then FTP it from the CF server to the FTP server.

    --

    Adam

    tgooldAuthor
    Inspiring
    October 27, 2009

    Thanks for clarifying that for me. I'll give that a try.