hanneman
asked on
cfcontent networked file
Is it possible to use CFCONTENT (or a similar custom tag) to send a file which is not on the host?
ASKER
sorry, I meant download. not upload.
ASKER
I would like to have the files for download on a seperate machine to the webhost.
<!--- This is the download file for coldfusion projects --->
<!--- pass the followitn 2 parameters & call this file as a TAG / Include / HREF
<CFSET sPath = "C:\Clients\ProjFolder\ana ndkp.cfm">
<CFSET sfile = "anandkp.cfm"> --->
<CFHEADER NAME="content-disposition" VALUE="attachment; filename=#sfile#">
<!--- file_to_be_download.cfm - Name of file to be downloaded. --->
<CFCONTENT TYPE="application/octet-st ream" FILE="#sPath#" DELETEFILE="FALSE" RESET="TRUE">
<!--- get teh physical [c:\asdas\asda\asdas.cfm] path for the file to be downloaded. --->
K'Rgds
Anand
<!--- pass the followitn 2 parameters & call this file as a TAG / Include / HREF
<CFSET sPath = "C:\Clients\ProjFolder\ana
<CFSET sfile = "anandkp.cfm"> --->
<CFHEADER NAME="content-disposition"
<!--- file_to_be_download.cfm - Name of file to be downloaded. --->
<CFCONTENT TYPE="application/octet-st
<!--- get teh physical [c:\asdas\asda\asdas.cfm] path for the file to be downloaded. --->
K'Rgds
Anand
ASKER
yes but that is for download from the local machine to client.
I am trying to download from a machine that is networked to the webhost, not from the webhost.
I am trying to download from a machine that is networked to the webhost, not from the webhost.
have u heard abt CFFTP
try this !
<!--- ========================== ========== ========== ==== CONNECT ========================== ========== ========== = --->
<CFFTP CONNECTION="Anand"
USERNAME="anonymous"
PASSWORD="userName@company .com"
SERVER = "192.168.3.165"
ACTION="Open"
STOPONERROR="Yes">
<!--- ========================== ========== ========== ========== ========== ========== ========== ========== ========== --->
<CFIF CFFTP.SUCCEEDED>
<!--- ************************** ********** ********** * FILES ************************** ********** ********** ** --->
<!--- transfer of the file - Sending on the FTP server --->
<CFFTP
ACTION = "putfile"
CONNECTION = "Anand"
LOCALFILE = "I:\akptest\akp.jpg"
REMOTEFILE = "ftp_akp1.jpg"
>
<!--- transfer of the file - Picking up from the FTP server --->
<CFFTP
ACTION = "getfile"
CONNECTION = "Anand"
LOCALFILE = "I:\akptest\akp2.jpg"
REMOTEFILE = "ftp_akp1.jpg"
>
<!--- ************************** ********** ********** * FOLDER ************************** ********** ********** * --->
<!--- Creating DIR on the FTP server --->
<CFFTP
ACTION = "createDir"
directory = "akp"
CONNECTION = "Anand"
>
<CFFTP
ACTION = "putfile"
CONNECTION = "Anand"
LOCALFILE = "I:\akptest\akp.jpg"
REMOTEFILE = "akp\ftp_akp1.jpg"
>
<!--- ========================== ========== ========== == CLOSE ========================== ========== ========== = --->
<CFFTP CONNECTION="Anand"
ACTION="close"
STOPONERROR="Yes">
</CFIF>
<!--- ========================== ========== ========== ========== ========== ========== ========== ========== ========== --->
K'Rgds
Anand
try this !
<!--- ==========================
<CFFTP CONNECTION="Anand"
USERNAME="anonymous"
PASSWORD="userName@company
SERVER = "192.168.3.165"
ACTION="Open"
STOPONERROR="Yes">
<!--- ==========================
<CFIF CFFTP.SUCCEEDED>
<!--- **************************
<!--- transfer of the file - Sending on the FTP server --->
<CFFTP
ACTION = "putfile"
CONNECTION = "Anand"
LOCALFILE = "I:\akptest\akp.jpg"
REMOTEFILE = "ftp_akp1.jpg"
>
<!--- transfer of the file - Picking up from the FTP server --->
<CFFTP
ACTION = "getfile"
CONNECTION = "Anand"
LOCALFILE = "I:\akptest\akp2.jpg"
REMOTEFILE = "ftp_akp1.jpg"
>
<!--- **************************
<!--- Creating DIR on the FTP server --->
<CFFTP
ACTION = "createDir"
directory = "akp"
CONNECTION = "Anand"
>
<CFFTP
ACTION = "putfile"
CONNECTION = "Anand"
LOCALFILE = "I:\akptest\akp.jpg"
REMOTEFILE = "akp\ftp_akp1.jpg"
>
<!--- ==========================
<CFFTP CONNECTION="Anand"
ACTION="close"
STOPONERROR="Yes">
</CFIF>
<!--- ==========================
K'Rgds
Anand
ASKER
here is how i solved the problem in the end:
1. share a directory on the file server.
2. create a user login on the network file server.
3. create identical login on the webserver.
4. services >> cold fusion server >> log on as >> change to the newly created login.
5. restart all servers.
5. use unc path name to access the files within the shared directory
<cfcontent file="\\{servername}\{shar ename}\{fi lename}"
thanks for your input anand, i will now ask for refund of points and to put this question into the PAQs as I think it has some value.
-h
1. share a directory on the file server.
2. create a user login on the network file server.
3. create identical login on the webserver.
4. services >> cold fusion server >> log on as >> change to the newly created login.
5. restart all servers.
5. use unc path name to access the files within the shared directory
<cfcontent file="\\{servername}\{shar
thanks for your input anand, i will now ask for refund of points and to put this question into the PAQs as I think it has some value.
-h
A request for deletion or PAQ has been made. If no response or you feel this is in error, comment. If no objection, myself or another Moderator will handle this question in three days.
Computer101
E-E Admin
Computer101
E-E Admin
fine - ur wish !
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
to send a file u'll need to use CFFTP / CFFILE
I guess CFFTP is what ur looking for !
K'Rgds
Anand