How do I use CFFILE to copy a file from a remote web server?

Posted on 2009-04-18
Last Modified: 2013-12-24
I need to copy a very specific file from a web server ... and I hoped <cffile action="copy" would assist BUT I get this error:

The cause of this exception was: C:\ColdFusion8\runtime\servers\coldfusion\SERVER-INF\temp\wwwroot-tmp\http:\\crm.txt (The filename, directory name, or volume label syntax is incorrect).

SO; it appears my 'source' won't point directly to\crm.txt ...

What on earth am I doing wrong!?

This is the exact CFFILE I'm trying to use:

<cffile action="copy" source="http:\\\jonesnsa.txt" destination="c:\Inetpub\wwwroot\nfa\mq.txt">

Question by:rcbuchanan
    LVL 19

    Expert Comment

    Source needs to be c:\foldername\filename.extention not http:\\server\filename
    LVL 63

    Assisted Solution

    I was near to help you but then I sow you are faker or at least helping a faker do his job.
    Or do you know ron jackson?
    LVL 16

    Accepted Solution

    If you're trying to copy the file from someone else's webserver, you'd have to use CFHTTP to GET it, specifying the Path attribute for where you want to save the file to (or use the CFHTTP.FileContent variable)

    Author Comment

    Good grief - Zvonko - the domain name - was just a random domain I tried to think of .... as a bloody example. ( I have NO idea who or what owns the domain ... )  Perhaps I'll use !!?!? as example.

    OBVIOUSLY I'm not going to tell my domain name's file ... for the save of obvious privacy.

    So relax mate. If you can help - great.


    Author Closing Comment

    Except for the conspiracy theory by Zvonko.
    AGAIN - and to be explicit - the domain name / filename i provided was IMAGINARY / made up ... as an example. Contrary to Zvonko's impressions - I have NO desire to attack anyone's web site. Am working to download an output file for weather from a weather site that provides for public domain.
    LVL 63

    Expert Comment

    Tell other boys stories. Today you deleted that file you named in the EXACT cffile statement but when I have tested the file was there.

    Author Comment

    Baloney. Shut up! Move on already.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
    Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
    This video discusses moving either the default database or any database to a new volume.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now