can someone give me a snippet of code that actually uses CFFTP for uploading
a file?  There are tons of examples for listing directories (Ben's book, the
docs, ect), but I cannot find one example of code for uploading a file. Here
is what I am trying

---set test varables-----
<cfset myfile = "D:\InetPub\wwwroot\images\sports\brain1.gif">
<cfset myfile_b = "brain1.gif">
<cfset attributes.channel = "sports">
<cfparam name="attributes.ftp_directory" default="/1624/">


----open connection-----
<cfftp action="open"
  server="#attributes.ftp_server#"
  username="#attributes.ftp_username#"
  password="#attributes.ftp_password#"
  stoponerror="#attributes.ftp_stoponerror#"
  port="#attributes.ftp_port#"
  CONNECTION="#attributes.ftp_CONNECTION#">
<P>Did it succeed? <CFOUTPUT>#CFFTP.Succeeded#</CFOUTPUT>

-----upload file --------

<cfftp action="putfile"
  localfile="#myfile#"
  remotefile="#attributes.ftp_directory##myfile_b#"
  failifexists="no"
  CONNECTION="#attributes.ftp_CONNECTION#"
  >
<P>Did it succeed? <CFOUTPUT>#CFFTP.Succeeded#</CFOUTPUT>

----- close connection -----
<cfftp action="close" connection="#attributes.ftp_CONNECTION#"
stoponerror="yes">
<P>Did it succeed? <CFOUTPUT>#CFFTP.Succeeded#</CFOUTPUT>

This is the error..... (lines 32-42 is the upload part of the operation)
      Error Diagnostic Information
      550 /1624/brain1.gif: Permission denied


      The error occurred while processing an element with a general
identifier of (CFFTP), occupying document position (32:1) to (42:3) in the
template file d:\Inetpub\wwwroot\neurotrash\newadmin\ftpupload.cfm.


      Date/Time: 10/14/00 17:34:52
      Browser: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
      Remote Address: 63.203.119.83




------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to