Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Hyperlink..

Hyperlink..

Scheduled Pinned Locked Moved Web Development
htmltutorialquestion
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Laing James
    wrote on last edited by
    #1

    Hi I am not sure if this is the correct forum category in which to pose this question, but I shall go ahead anyway..if it is not then, please advise.. Could anyone advise me as to how I might, if it is at all possible, define a hyperlink in an HTML document that supports the following characteristics: 1. The target is a plain ASCII file that should be displayed in a new window, say for example using WORDPAD or NOTEPAD and not explorer, so that plain text formatting is honoured. 2. That if the user right clicks the link, a/the popup menu provides the ability to view or 'run' the target; which will be launched by own application. Note, the filetype, for example '.ABC' of the target, has already been registered/associated with my application. I would like to be able to offer the two options; so that the user can view the target file or launch my application against the file. Best regards. James.

    B 1 Reply Last reply
    0
    • L Laing James

      Hi I am not sure if this is the correct forum category in which to pose this question, but I shall go ahead anyway..if it is not then, please advise.. Could anyone advise me as to how I might, if it is at all possible, define a hyperlink in an HTML document that supports the following characteristics: 1. The target is a plain ASCII file that should be displayed in a new window, say for example using WORDPAD or NOTEPAD and not explorer, so that plain text formatting is honoured. 2. That if the user right clicks the link, a/the popup menu provides the ability to view or 'run' the target; which will be launched by own application. Note, the filetype, for example '.ABC' of the target, has already been registered/associated with my application. I would like to be able to offer the two options; so that the user can view the target file or launch my application against the file. Best regards. James.

      B Offline
      B Offline
      Bradml
      wrote on last edited by
      #2

      Laing,James wrote:

      The target is a plain ASCII file that should be displayed in a new window, say for example using WORDPAD or NOTEPAD and not explorer, so that plain text formatting is honored.

      Well you can Half do this. You can get a browser to honor the plain text formating by naming the file *.txt (Astrix is wild card) or you can set the headers on the output to a text file. A PHP example is: <?php header('Content-type: text'); ?> Standard text here. and Here. And perhaps even here. so this tells the browser to render the content as text.

      Laing,James wrote:

      2. That if the user right clicks the link, a/the popup menu provides the ability to view or 'run' the target; which will be launched by own application. Note, the filetype, for example '.ABC' of the target, has already been registered/associated with my application.

      ok this you can do this IF the application is installed on the clients computer. Say you had a file you wanted to be rendered as a PDF, well again you use the content you use the Content-Type Headers. <?php header('Content-type: application/pdf'); // Only throw the next line if you want the save dialog to be presented to the user, the filename parameter is what the default filename should be. header('Content-Disposition: attachment; filename="default_filename.pdf"'); ?> This will be formatted as a PDF file..... I hope this is what you wanted.... BTW I am sure that this works with AJAX. Finally remember that the headers MUST be the first thing sent down to the browser, therefore this will NOT work if anything is sent down before it, including blank lines.


      Brad Australian "The Probability of you doing that makes 0 look like a big number" - My Mate Oxley

      L 1 Reply Last reply
      0
      • B Bradml

        Laing,James wrote:

        The target is a plain ASCII file that should be displayed in a new window, say for example using WORDPAD or NOTEPAD and not explorer, so that plain text formatting is honored.

        Well you can Half do this. You can get a browser to honor the plain text formating by naming the file *.txt (Astrix is wild card) or you can set the headers on the output to a text file. A PHP example is: <?php header('Content-type: text'); ?> Standard text here. and Here. And perhaps even here. so this tells the browser to render the content as text.

        Laing,James wrote:

        2. That if the user right clicks the link, a/the popup menu provides the ability to view or 'run' the target; which will be launched by own application. Note, the filetype, for example '.ABC' of the target, has already been registered/associated with my application.

        ok this you can do this IF the application is installed on the clients computer. Say you had a file you wanted to be rendered as a PDF, well again you use the content you use the Content-Type Headers. <?php header('Content-type: application/pdf'); // Only throw the next line if you want the save dialog to be presented to the user, the filename parameter is what the default filename should be. header('Content-Disposition: attachment; filename="default_filename.pdf"'); ?> This will be formatted as a PDF file..... I hope this is what you wanted.... BTW I am sure that this works with AJAX. Finally remember that the headers MUST be the first thing sent down to the browser, therefore this will NOT work if anything is sent down before it, including blank lines.


        Brad Australian "The Probability of you doing that makes 0 look like a big number" - My Mate Oxley

        L Offline
        L Offline
        Laing James
        wrote on last edited by
        #3

        Thanks Brad!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups