Embedding Files In HTML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Oralloy
    Recognized Expert Contributor
    • Jun 2010
    • 988

    Embedding Files In HTML

    Folks,

    This is a rather obtuse question, but I have an application where it might be advantageous for me to embed an arbitrary file in a HTML/DHTML file, and make it accessible via a button.

    What I want to do is create a number of elements - images are fine, hang a javaScript function references on the onClick() (or is it onMouseUp()) events.

    The javaScript function should then pop a browser or save dialogue for the user to deal with the embedded content.

    Is this reasonable? If so, how best to go about it?

    Thank You!
    Oralloy
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    so basically it should be a file download?

    Comment

    • Oralloy
      Recognized Expert Contributor
      • Jun 2010
      • 988

      #3
      Essentially, gits.

      What I'm trying to do is build a project final report which holds all files that were archived as part of the project. This is just the most ticklish aspect.

      I'd be even happier, if I could set this up as a word document or a PDF, but I'm not certain how to go either under Java.

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        not sure whether i get it already ... you have some files and and want the user to have access to them? you have a webpage where you want to have some 'action-elements' that trigger a download of any of that files. basically a simple link to the file would do the job ... you could even open a window with window.open() and set it's location property to the file-path. if you want to force a download then you might have a serverside service that reads the file and deliver the plain content and additionally you would set the content-disposition header to attachment.

        or did i misunderstand the issue?

        Comment

        • Oralloy
          Recognized Expert Contributor
          • Jun 2010
          • 988

          #5
          Well, the page is a physical archive element, so it would be best if the body of the documents were carried in the page.

          Comment

          • gits
            Recognized Expert Moderator Expert
            • May 2007
            • 5390

            #6
            hmmm ... i cannot imagine what you mean or i just don't get it :( ... could you give a short example or description how the 'page' looks like? is it a html-document? what is it what the browser should/will get?

            Comment

            • Oralloy
              Recognized Expert Contributor
              • Jun 2010
              • 988

              #7
              Example

              Gits,

              Here's a word document setup with embedded objects.

              Ultimately I'd like to produce something like this for my report.

              However, I'll settle for HTML in the near term, as it will at least give me everything in one place.

              And yes, it's being generated out of a web application, although that's not the core problem, as far as I can tell.

              Thanks,
              Oralloy


              p.s. The file is in the .zip, the bare document file exceed the forum limit.
              Attached Files
              Last edited by Oralloy; Aug 25 '10, 11:26 PM. Reason: comment on attachment.

              Comment

              Working...