freelanceprogrammers.org Forum Index » Cold Fusion

CFFTP - uploading files


View user's profile Post To page top
zamvil Posted: Mon Nov 07, 2005 11:37 pm


Joined: 27 Aug 2005

Posts: 6
CFFTP - uploading files
Hi, I`m using CFFTP to upload files but I have a problem.

I`m using the <input type=`file`...> to select the local file that I
want to upload to the FTP server but when I do the upload I want to
upload the file with the same name of the local file, how can I get
file name of the local file that I am uploading. Like <CFSET
FileName=#File.ServerFile#> when is using CFfile.

I have this.

UPLOAD1.CFM
--------------
<cfform name="form2" enctype="multipart/form-data" method="post"
action="upload_2.cfm" >
<p>Seleccione el archivo:</p>
<p><input type="file" name="file1" size="50"> </p>
<p>
<input type="submit" name="Submit" value="Subir">
</p>
</cfform>


------------------
UPLOAD_2.CFM
------------------
<cfftp connection = "myConnection"
username = "test"
password = "test"
server = "SERVER.COM"
action = "open" transfermode="auto"
stopOnError = "Yes">


<cfftp connection="myConnection"
username = "test"
password = "test"
server = "SERVER.COM"
action="putfile"
localfile="#file1#"
remoteFile="/">


<p>Close the connection:
<cfftp connection = "myConnection"
action = "close"
stopOnError = "Yes">
Reply with quote
Send private message
View user's profile Post To page top
zamvil Posted: Tue Nov 08, 2005 4:58 am


Joined: 27 Aug 2005

Posts: 6
CFFTP - uploading files
In other words can I uploading files dynamically with the CFFTP tag?

ACTION="PutFile"
REMOTEFILE="/graphics/#nameoffilechosen#"
LOCALFILE="#nameoffilechosen#">



--- In cold_fusion@yahoogroups.com, "Alex Zamora" <mzamora@c...>
wrote:
>
> Hi, I`m using CFFTP to upload files but I have a problem.
>
> I`m using the <input type=`file`...> to select the local file that
I
> want to upload to the FTP server but when I do the upload I want
to
> upload the file with the same name of the local file, how can I
get
> file name of the local file that I am uploading. Like <CFSET
> FileName=#File.ServerFile#> when is using CFfile.
>
> I have this.
>
> UPLOAD1.CFM
> --------------
> <cfform name="form2" enctype="multipart/form-data" method="post"
> action="upload_2.cfm" >
> <p>Seleccione el archivo:</p>
> <p><input type="file" name="file1" size="50"> </p>
> <p>
> <input type="submit" name="Submit" value="Subir">
> </p>
> </cfform>
>
>
> ------------------
> UPLOAD_2.CFM
> ------------------
> <cfftp connection = "myConnection"
> username = "test"
> password = "test"
> server = "SERVER.COM"
> action = "open" transfermode="auto"
> stopOnError = "Yes">
>
>
> <cfftp connection="myConnection"
> username = "test"
> password = "test"
> server = "SERVER.COM"
> action="putfile"
> localfile="#file1#"
> remoteFile="/">
>
>
> <p>Close the connection:
> <cfftp connection = "myConnection"
> action = "close"
> stopOnError = "Yes">
>
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help