Link to home
Start Free TrialLog in
Avatar of hanneman
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?
Avatar of anandkp
anandkp
Flag of India image

CFContent can be used to DOWNLOAD a file
to send a file u'll need to use CFFTP / CFFILE

I guess CFFTP is what ur looking for !

K'Rgds
Anand
Avatar of hanneman
hanneman

ASKER

sorry, I meant download. not upload.
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\anandkp.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-stream" FILE="#sPath#" DELETEFILE="FALSE" RESET="TRUE">  
<!--- get teh physical [c:\asdas\asda\asdas.cfm] path for the file to be downloaded. --->

K'Rgds
Anand
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.
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
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}\{sharename}\{filename}"

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
fine - ur wish !
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial