[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Wyvern63 [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 3 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Kronin555 [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 4 [islastshown] => 1 [isfirstshown] => [attachments] => [allattachments] => ) --> Downloading files - Coldfusion - Advanced Techniques

Downloading files - Coldfusion - Advanced Techniques

My application allows users to download and ASCII file and save it to their hard drive. This works fine except that it appears to add blank lines at the end of the file. This is the code used: <CFHEADER NAME="Content-Disposition" VALUE="Inline;filename=#FileName#"> <CFCONTENT TYPE="application/plain"> Any thoughts on why it would add blank lines? Thanks....

  1. #1

    Default Downloading files

    My application allows users to download and ASCII file and save it to their
    hard drive. This works fine except that it appears to add blank lines at the
    end of the file. This is the code used:

    <CFHEADER NAME="Content-Disposition" VALUE="Inline;filename=#FileName#">
    <CFCONTENT TYPE="application/plain">

    Any thoughts on why it would add blank lines?

    Thanks.

    Kimmers1125 Guest

  2. #2

    Default Re: Downloading files

    Make sure that all your code in single line <CFHEADER
    NAME='Content-Disposition' VALUE='Inline;filename=#FileName#'><CFCONTENT
    TYPE='application/plain'> no enter You can also make your link to be like this
    getfile.cfm?id=5/filename.txt This will force the browser to show the save
    as dialouge

    Suzan Guest

  3. #3

    Default Downloading Files

    I am currently trying to download a file that has been uploaded to a server
    using CF. I log in to the site which creates a validating cookie use the file
    upload site interface, then go to the file download interface to retrieve it.
    What I end up getting though is the files displayed in the browser instead of
    the save as dialog. Is there a technique that will activate the save as dialog
    no matter what the extension?:confused;

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <cfif Not IsDefined("Cookie.avesse02")>
    <cfif Not IsDefined("Cookie.wp02")>
    <cflocation url="../login/unauthorizedUserPage.cfm">
    <cfelseif IsDefined("Cookie.wp02")>
    <cfset Variables.target="#URL.target#">
    <cflocation url="../avesseCustomers/#Cookie.avesse01#/#Variables.target#"
    addtoken="no">
    </cfif>
    <cfelseif IsDefined("Cookie.avesse02")>
    <cfset Variables.target="#URL.target#">
    <cflocation url="../avesseCustomers/#Cookie.avesse01#/#Variables.target#"
    addtoken="no">
    </cfif>
    <html>
    <head>
    <script language="JavaScript">
    <!--
    function redirect(URLStr)
    {
    location = "/secure/avesseFTPa.cfm";
    }
    //-->
    </script>
    </head>
    <body>
    <script language="JavaScript">
    <!--
    redirect()
    //-->
    </script>
    </body>
    </html>


    Wyvern63 Guest

  4. #4

    Default Re: Downloading Files

    First off, please don't crosspost. It's considered very bad form.

    To answer your question, look into <cfcontent> and <cfheader>.

    Here's code for a pdf file:

    <cfheader name="Content-Disposition" value="attachment; filename=saveme.pdf">
    <cfcontent type="application/pdf" deletefile="No" file="#filename#"> <!--
    filename should be the full pathname --->

    Kronin555 Guest

Similar Threads

  1. Downloading Files Using CF
    By Wyvern63 in forum Coldfusion Server Administration
    Replies: 1
    Last Post: October 26th, 04:41 AM
  2. Up and downloading files
    By knalle in forum Macromedia ColdFusion
    Replies: 2
    Last Post: April 26th, 02:59 PM
  3. Downloading Files with readfile
    By Marcus de Leon in forum PHP Development
    Replies: 1
    Last Post: July 13th, 09:52 PM
  4. Downloading Publisher FIles
    By mh53j_fe in forum Web Design
    Replies: 7
    Last Post: June 7th, 06:01 PM
  5. downloading gz compressed files?
    By yawnmoth in forum PHP Development
    Replies: 3
    Last Post: October 1st, 02:19 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •