Solved

CFTP Generating Error when trying to upload

Posted on 2004-10-28
540 Views
Last Modified: 2013-12-24
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!
0
Question by:swhitlow
    3 Comments
     
    LVL 8

    Accepted Solution

    by:
    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
     

    Author Comment

    by:swhitlow
    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
     
    LVL 8

    Expert Comment

    by:sigmacon
    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    The Complete Ruby on Rails Developer Course

    Ruby on Rails is one of the most popular web development frameworks, and a useful tool used by both startups and more established companies to build strong graphic user interfaces, and responsive websites and apps.

    A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
    Article by: kevp75
    Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    875 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now