• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 354
  • Last Modified:

cfcontent networked file

Is it possible to use CFCONTENT (or a similar custom tag) to send a file which is not on the host?
0
hanneman
Asked:
hanneman
  • 4
  • 4
  • 2
1 Solution
 
anandkpCommented:
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
0
 
hannemanAuthor Commented:
sorry, I meant download. not upload.
0
 
hannemanAuthor Commented:
I would like to have the files for download on a seperate machine to the webhost.
0
[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 
anandkpCommented:
<!--- 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
0
 
hannemanAuthor Commented:
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.
0
 
anandkpCommented:
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
0
 
hannemanAuthor Commented:
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
0
 
Computer101Commented:
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
0
 
anandkpCommented:
fine - ur wish !
0
 
Computer101Commented:
Points refunded and placed in PAQ

Computer101
E-E Admin
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now