CFTP Generating Error when trying to upload

When I try and do a simple ftp upload from a form I get the following error message on line 17 (the password is correct by the way):

An exception occurred when performing the FTP putfile operation.
The cause of this exception was that: 550 neotmp25612.tmp: Cannot create file. .
15 : <cfftp action="putfile"
16 : username="username"
17 : password="password"
18 : server="servername"
19 : passive="yes"

Here is the code I am using to do this upload:

<CFIF isdefined ("FORM.Upload")>
<cfftp action="open"
        username="username"
        password="password"
        server="server"
        stopOnError="yes"
           passive="yes"
        name="ftpthefile">
<cfftp action="putfile"
username="username"
password="password"
server="server"
passive="yes"
localfile="#UploadMe#"
remotefile="#UploadMe#"
transfermode="auto"
stoponerror="yes">
<cflocation url="uploadsermon.cfm?Note=File Succefully Uploaded!">
 </CFIF>

<html>
   <head>
      <title>Upload</title>
   </head>

 <body>

<cfparam name="URL.Note" default="">
<CFOUTPUT>
    <strong><font color="RED">#URL.NOTE#</font></strong>
</CFOUTPUT>

<form action="uploadsermon.cfm" method="post" enctype="multipart/form-data">
<input name="UPLOAD" type="hidden" value="Y">
 Media File Name:<BR>
<INPUT NAME="UploadMe" TYPE="File" SIZE="50">
<br>
Sermon Name<br>
<input name="SermonName" type="text" size="50">
<br>
Speaker<br>
<input name="Speaker" type="text" size="50">
<br>
Date<br>
<cfset ThisCalMonth = DateFormat(Now(), "MMMM DD, YYYY")>
<input name="DateOfSermon" type="text" value="<cfoutput>#ThisCalmonth#</cfoutput>" size="50">
<BR>
<input type="Submit" value="Upload Now">
 </form>




Basically, I am just wanting to have the user be able to upload a file and transfer it to our ftp server. Of course, I can get full access to the ftp server. Any suggestion? Thanks alot!
swhitlowAsked:
Who is Participating?
 
sigmaconCommented:
localfile="#UploadMe#"
remotefile="#UploadMe#"

Your remote file name must be relative to your FTP root directory, e.g. /secret/newsecrectfile.bin

Your local file is a fully specified path such as C:\OldSecrets\NobodysBusiness.bin

Also, before you can use a file that has been uploaded to your server, you SHOULD use <cffile action="upload" ...

Please do a <cfdump var="#UploadMe#"> right before your FTP call and report the output.

Finally, since your second CFFTP doesn't use the connection created in the first one, you can leave out the first one.
0
 
swhitlowAuthor Commented:
Let me try this and I'll get back to you. One thing I did notice while I was looking at the variables is that I get a weird filename - not the one that I chose from the "Browse File" input box. I get the "neotmp25612.tmp" filename instead. Is this because I am not using the <cffile action="upload"> function first?

Thanks!
0
 
sigmaconCommented:
Yes. Of course you could use this name to upload the file, but using <cffile action="upload"> is - in my opinion - easier and also gives you additional information otherwise not available. dump the cffile structure after calling the tag and you'll see what I mean ;-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.