About filetypes in link

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sasimca007
    New Member
    • Sep 2007
    • 129

    About filetypes in link

    Hello friends,
    I have one smalll doubt that when we write a link with anchor tag we are giving the url as href to where it should redirect, my question is when we click that link the link willl automatically redirect to the url we had given, but my intension is when we click that link the file should be downloaded like
    in some sites when we click a link the browser is asks for save the file (or) open that with that for any software. Like that i want the coding when we click the link the browser has to ask save this file or open this file.

    My configuration is,
    I am using modperl , Apache server, Linux operating system and the file type is CSV.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    if the browser doesn't have the appropriate plugin or supports the file type natively, the download prompt will be the default action. otherwise you have to set the "content-disposition" header to "attachment ".

    Comment

    • sasimca007
      New Member
      • Sep 2007
      • 129

      #3
      About link

      Hai friend i searched in the internet, i found what u saying but nobody telling how to? can u please send me sample code please

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        e.g. this one (though slightly different)

        Comment

        • sasimca007
          New Member
          • Sep 2007
          • 129

          #5
          About filetypes in link

          Hi friend,
          I tried that but it is telling that Invalid command 'Header', when i restarted the apache. May be a module should be install for that Header and one more thing i should tell you that is the filetype is not cvs it is csv. Sorry for confusing and wrong information.

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            which modules (besides mod_perl) are installed on the server?

            Comment

            • sasimca007
              New Member
              • Sep 2007
              • 129

              #7
              About filetypes in link

              Hi friend, thanks for the help i got it by using Apache::File module

              Comment

              Working...