Results 1 to 4 of 4

Thread: cfheader and cfcontent disposition inline

  1. #1
    Join Date
    Jan 2009
    Posts
    110

    cfheader and cfcontent disposition inline

    I am using CF application for a company where a user can upload files to the server and only the selective users can only download that file.I have try to do the above this with a normal user and i say that a user is able to upload the file from the CF application, but when a user try to download the same file he is not able to download the file when i am using CFHeader and CFContent to download the file at over here i am get unwanted results.I don't know what mistake i have made where i can upload the files properly but cannot download the files.Can anyone help me out with this issue.

  2. #2
    Join Date
    May 2008
    Posts
    2,389

    Re: cfheader and cfcontent disposition inline

    Try to use the following code

    Code:
    <cfif Right(filename,3) EQ ",mp3" or Right(filename,3) EQ "avi">
                      <cfheader name="Content-Disposition"  value="attachment; filename=#downloadFilename#">
                <cfelse>
                      <cfheader name="Content-Disposition"  value="inline; filename=#downloadFilename#">
                </cfif>
                
    <cfswitch expression="#Right(filename,3)#">
    <cfcase value="ai"><cfset MIME = "application/postscript"></cfcase>
    <cfcase value="aif"><cfset MIME = "audio/x-aiff"></cfcase>
                      <cfcase value="aifc"><cfset MIME = "audio/x-aiff"></cfcase>
                      <cfcase value="aiff"><cfset MIME = "audio/x-aiff"></cfcase>
                      <cfcase value="asc"><cfset MIME = "text/plain"></cfcase>

  3. #3
    Join Date
    Jan 2009
    Posts
    110

    Re: cfheader and cfcontent disposition inline

    I have try to use the above code with cfheader and cfcontent but still user is not able to download the file

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: cfheader and cfcontent disposition inline

    Try to use the replaced this code and hope it works for you.

    Code:
    <cfheader name="Content-Disposition" value="inline; filename=#GetFile.FileName#">
    or
    <cfheader name="Content-Disposition" value="attachment; filename=#GetFile.FileName#">

Similar Threads

  1. Replies: 5
    Last Post: 21-09-2011, 12:58 AM
  2. Don't know about an inline class
    By Bottlenecked in forum Software Development
    Replies: 5
    Last Post: 25-01-2010, 09:57 AM
  3. What is the use of inline function
    By Jabeen in forum Software Development
    Replies: 3
    Last Post: 19-11-2009, 12:22 PM
  4. Problem with static and inline in C++
    By Sujit15 in forum Software Development
    Replies: 3
    Last Post: 06-05-2009, 01:15 PM
  5. Virtual inline in C++
    By Jacek in forum Software Development
    Replies: 5
    Last Post: 27-12-2008, 12:57 PM

Tags for this Thread

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
  •  
Page generated in 1,751,557,249.96872 seconds with 16 queries