FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old September 3rd, 2003, 10:06 AM
KIMMIE KIMMIE is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: md
Posts: 6 KIMMIE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
cfftp and delete

hi all,

i'm trying to use cfftp to putfile to a server then delete a file locally... but it doesn't work. can anyone help?

open a connection

cfftp.... putfile... local...to..remote

close connection


delete... local file...

error: invalid attribute <cffile action="delete" file="....">
filename....

Reply With Quote
  #2  
Old September 3rd, 2003, 11:22 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
Please post the actual error message.

Reply With Quote
  #3  
Old September 3rd, 2003, 02:01 PM
KIMMIE KIMMIE is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: md
Posts: 6 KIMMIE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
attribute validation error for cffile... that is for cffile write

Reply With Quote
  #4  
Old September 3rd, 2003, 02:03 PM
KIMMIE KIMMIE is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: md
Posts: 6 KIMMIE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
The value of the attribute file, which is currently "c:\CFusionMX\wwwroot\myapps\upload-2-server\monthly-pages\file2.cfm", is invalid.

Reply With Quote
  #5  
Old September 3rd, 2003, 02:05 PM
KIMMIE KIMMIE is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: md
Posts: 6 KIMMIE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
it's weird because if i delete the file first then upload... the delete will work. but if i upload then delete either with the connection open or closed... it will not work.

Reply With Quote
  #6  
Old September 3rd, 2003, 06:19 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
hmmm...ok, could you post the actual code that you are trying to run?

also, what version of CF are you using?

Reply With Quote
  #7  
Old September 4th, 2003, 08:27 AM
KIMMIE KIMMIE is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: md
Posts: 6 KIMMIE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i am using dreamweaver coldfusionMX.
Code:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<cfset filenameupl="monthly-pages\file2.cfm">
<cfset filenamedel="monthly-pages\file2.cfm">
Testing upload then delete a file<br>



1. Upload<br>
<cfif fileexists("C:\CFusionMX\wwwroot\myapps\upload-2-server\#filenameupl#") or
fileexists("C:\CFusionMX\wwwroot\myapps\upload-2-server\trashcan\#filenameupl#")>
<!-- OPEN CONNECTION -->
<cfftp connection="myconnection"
server="servername"
stoponerror="yes"
username="user"
password="passwd"
action="open">


<cfif CFFTP.Succeeded>
<cfoutput>
uploaded #filenameupl# <br>
<cfset newfilename = #Replace(filenameupl, "\", "/", "all")#>
<!-- PUT FILE TO REMOTE SERVER -->
<cfif fileexists("C:\CFusionMX\wwwroot\myapps\upload-2-server\#filenameupl#")>
<cfftp connection="myconnection"
action="putfile"
localfile="c:\CFusionMX\wwwroot\myapps\upload-2-server\#filenameupl#"
remotefile="/remote/announcements/#newfilename#"
transfermode="AUTO">
<cfelse>
<cfftp connection="myconnection"
action="putfile"
localfile="c:\CFusionMX\wwwroot\myapps\upload-2-server\trashcan\#filenameupl#"
remotefile="/remote/announcements/#newfilename#"
transfermode="AUTO">
</cfif>

</cfoutput>

<!-- DISCONNECT FROM SERVER -->
<cfftp connection="myconnection"
server="servername"
stoponerror="yes"
action="close">


<cfelse>
There was an error connecting to the FTP server.<br>
<hr><br><cfoutput> CFFTP.ErrorText </cfoutput>
</cfif>


</cfif>

2. Delete<br>
<cfif fileexists("C:\CFusionMX\wwwroot\myapps\upload-2-server\#filenamedel#")>
<cfoutput>
deleted #filenamedel# <br>
<cffile action="delete" file="c:\CFusionMX\wwwroot\myapps\upload-2-server\#filenamedel#">
</cfoutput>
</cfif>


</body>
</html>

Last edited by KIMMIE : September 4th, 2003 at 08:30 AM.

Reply With Quote
  #8  
Old September 4th, 2003, 08:49 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
hmmm, very strange because if the file didn't exist you would not get past this line:

<cfif fileexists("C:\CFusionMX\wwwroot\myapps\upload-2-server\#filenamedel#")>

My guess is that maybe the file is still locked and in use by the ftp put when the engine gets to the cffile. Can you try doing the upload and the delete in two different requests and see if it works then?

Also, just for fun, can you do any other CFFILE operations on the file after the PUT? Like rename or read?

Reply With Quote
  #9  
Old September 4th, 2003, 10:18 AM
KIMMIE KIMMIE is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: md
Posts: 6 KIMMIE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
copy works

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > cfftp and delete


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway