Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CFTP Generating Error when trying to upload

Posted on 2004-10-28
3
Medium Priority
?
555 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
Comment
Question by:swhitlow
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
sigmacon earned 2000 total points
ID: 12439502
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
ID: 12446177
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
ID: 12446592
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

Featured Post

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

916 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