Skip to main content
Known Participant
September 21, 2015
Question

cfcontent generated unwanted script header

  • September 21, 2015
  • 1 reply
  • 470 views

I have this weird thing happened to cfcontent.

<cfheader name="Content-Disposition" value="attachment;filename=#LSDateFormat(now(),"mm.dd.yy")#.txt">


<cfcontent type="text/plain">
<cfoutput>test_1,test_2,test_3,timestamp#chr(10)#</cfoutput>

This is what generated in the txt file.  It generated the output which I want but also generated the default cfide scripts.  How would I suppress and generate only the output stuff?  Thanks.

<script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/masks.js"></script>
<script type="text/javascript">
<!--
    _CF_checkheader_search = function(_CF_this)
    {
        //reset on submit
        _CF_error_exists = false;
        _CF_error_messages = new Array();
        _CF_error_fields = new Object();
        _CF_FirstErrorField = null;


        //display error messages and return success
        if( _CF_error_exists )
        {
            if( _CF_error_messages.length > 0 )
            {
                // show alert() message
                _CF_onErrorAlert(_CF_error_messages);
                // set focus to first form error, if the field supports js focus().
                if( _CF_this[_CF_FirstErrorField].type == "text" )
                { _CF_this[_CF_FirstErrorField].focus(); }

            }
            return false;
        }else {
            return true;
        }
    }
//-->
</script>

test_1,test_2,test_3,timestamp

    This topic has been closed for replies.

    1 reply

    Known Participant
    September 22, 2015

    I think the cfcontent generated that script header stuff.  Any ideas why or a work around that?

    Thanks.

    Known Participant
    September 22, 2015

    It's because of the Application.cfc that generated script so the cfcontent will take that.  I tried to create sub Application file but it keeps throwing me errors, unable to connect to the component.  I have tried different path to the cfc files but still couldn't find them.  Any suggestions on this?

    Thanks.