• Lucid Dreaming - Dream Views




    Page 1 of 2 1 2 LastLast
    Results 1 to 25 of 26
    1. #1
      Member really's Avatar
      Join Date
      Sep 2006
      Gender
      Posts
      2,676
      Likes
      56

      Website programming

      Hey,

      Can anybody help me program, using Dreamweaver, a dialogue box to pop up on a custom website? I.e. "You're about to download... Open/Save File/Cancel"

      Thanks in advance.

    2. #2
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      Woah, what on earth are you trying to achieve here?
      I think a little more detail is required

      from the one-liner above, it sounds like you're trying to mimic what browsers already do (Ie. manage file downloads)
      This is not a good thing to try to do

      if you try to override people's browsers,
      1) you won't succeed, you will not be able to support all browsers on all platforms under all circumstances
      2) even if you do, you will piss people off by doing it
      3) any simple update to a browser could render your mimic worthless

      I'm assuming the "open" option means download the file to a temp location and open it in some application local to the user
      you cannot do this (not properly anyway)
      you can't control what the user does on his machine

      seriously, if you want to offer something for download, just use a simple anchor
      let the user decide what they want to do with the file
      (\_ _/)
      (='.'=)
      (")_(")

    3. #3
      Member really's Avatar
      Join Date
      Sep 2006
      Gender
      Posts
      2,676
      Likes
      56
      Quote Originally Posted by Ynot View Post
      Woah, what on earth are you trying to achieve here?
      I think a little more detail is required

      from the one-liner above, it sounds like you're trying to mimic what browsers already do (Ie. manage file downloads)
      This is not a good thing to try to do

      if you try to override people's browsers,
      1) you won't succeed, you will not be able to support all browsers on all platforms under all circumstances
      2) even if you do, you will piss people off by doing it
      3) any simple update to a browser could render your mimic worthless

      I'm assuming the "open" option means download the file to a temp location and open it in some application local to the user
      you cannot do this (not properly anyway)
      you can't control what the user does on his machine

      seriously, if you want to offer something for download, just use a simple anchor
      let the user decide what they want to do with the file
      Oh, ok. I wasn't aware I just had to do that.

      So how do you do this?

      Attempt to paste the file and link it via html? - But then It'd probably open up through the browser rather than through a dialogue box...

    4. #4
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      what exactly are you offering to your visitors?
      (\_ _/)
      (='.'=)
      (")_(")

    5. #5
      Member really's Avatar
      Join Date
      Sep 2006
      Gender
      Posts
      2,676
      Likes
      56
      Quote Originally Posted by Ynot View Post
      what exactly are you offering to your visitors?
      I want to try:

      Mp3s, Jpegs and Pdfs.

    6. #6
      ex-redhat ClouD's Avatar
      Join Date
      Sep 2007
      Posts
      4,760
      Likes
      129
      DJ Entries
      1
      I think he just wants an automatic browser based download box to come up, but is unsure how to get one to, as opposed to file automatically opening in the browser.
      You merely have to change your point of view slightly, and then that glass will sparkle when it reflects the light.

    7. #7
      Member really's Avatar
      Join Date
      Sep 2006
      Gender
      Posts
      2,676
      Likes
      56
      Quote Originally Posted by ClouD View Post
      I think he just wants an automatic browser based download box to come up, but is unsure how to get one to, as opposed to file automatically opening in the browser.
      Yep.

    8. #8
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      if the user wants to download it, he'll download it
      if he wants to have it open in his browser via a plugin, he'll do that

      trying to override what someone's browser does is futile and will only annoy them
      (\_ _/)
      (='.'=)
      (")_(")

    9. #9
      Member really's Avatar
      Join Date
      Sep 2006
      Gender
      Posts
      2,676
      Likes
      56
      Quote Originally Posted by Ynot View Post
      if the user wants to download it, he'll download it
      if he wants to have it open in his browser via a plugin, he'll do that

      trying to override what someone's browser does is futile and will only annoy them
      Ok, how do I offer a download?

      They click a file, and a dialogue box appears. This is what I mean.

      I don't see how it screws with anything.

    10. #10
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      I don't think a website can do that, that would be a browser setting. Just add a line of text that says "Ctrl + Click and Press Download Linked File As..." right above the link.

    11. #11
      Member really's Avatar
      Join Date
      Sep 2006
      Gender
      Posts
      2,676
      Likes
      56
      Ok, so I guess I just paste the file into html document and link to that?

      Still not sure, but I realize how simple it is.

    12. #12
      Eprac Diem arby's Avatar
      Join Date
      May 2006
      LD Count
      i/0
      Gender
      Location
      Canada
      Posts
      1,957
      Likes
      52
      Link to the file on your webserver and it'll download or display automatically.

    13. #13
      Member really's Avatar
      Join Date
      Sep 2006
      Gender
      Posts
      2,676
      Likes
      56
      HOW!!??

      rofl

    14. #14
      ex-redhat ClouD's Avatar
      Join Date
      Sep 2007
      Posts
      4,760
      Likes
      129
      DJ Entries
      1
      Upload the file via ftp to a server you own, then use a normal link directing to the file.
      You merely have to change your point of view slightly, and then that glass will sparkle when it reflects the light.

    15. #15
      Member really's Avatar
      Join Date
      Sep 2006
      Gender
      Posts
      2,676
      Likes
      56
      Thanks everyone, I'll post again if something's not right.

      ;D

    16. #16
      dsr
      dsr is offline
      我是老外,可是我會說一點中文。
      Join Date
      Nov 2006
      Gender
      Location
      my mind
      Posts
      374
      Likes
      1
      To create an anchor to a file on your server, assuming your server is located at the domain name www.example.com, use the following line of HTML:

      <a href="http://www.example.com/example.mp3">click here to download music illegally</a>

    17. #17
      Member really's Avatar
      Join Date
      Sep 2006
      Gender
      Posts
      2,676
      Likes
      56
      Cheers!

      Also, how do I:

      1. Allow for scroll bars if images are larger than the window?
      2. Fix the width of sub-windows/frames?

    18. #18
      ex-redhat ClouD's Avatar
      Join Date
      Sep 2007
      Posts
      4,760
      Likes
      129
      DJ Entries
      1
      1. I think it's default auto(?)

      2. Fixing a table width is as easy as slightly adjusting the html if you're using Dreamweaver.

      Tables are areas for cells.
      TR stands for table row, and creates rows within the table.
      TD is table data, and creates cells within the row.

      So you should see (in Dreamweaver's html view section - I assume they have one) something similar to this throughout the html:
      HTML Code:
      <table>
       <tr>
         <td>
         </td>
       </tr>
      </table>
      You can use width as either a set number like this:
      HTML Code:
      <table width="300">
       <tr>
         <td>
         </td>
       </tr>
      </table>
      or a percentage like this:
      HTML Code:
       <table width="80&#37;">
        <tr>
          <td>
          </td>
        </tr>
       </table>
      The fixed will not auto adjust in a browser if the user adjusts the size of the window.
      The percentage adjusts the table to the browser window, using the value you set.

      The same can be done with the TD cells in relation to the table:
      HTML Code:
      <td width="100%"></td>
      Also alignment the same way:
      HTML Code:
      <td width="100%" align="left"></td>
      You merely have to change your point of view slightly, and then that glass will sparkle when it reflects the light.

    19. #19
      Member really's Avatar
      Join Date
      Sep 2006
      Gender
      Posts
      2,676
      Likes
      56
      Nice! Thanks a lot.

    20. #20
      Member really's Avatar
      Join Date
      Sep 2006
      Gender
      Posts
      2,676
      Likes
      56
      Actually, although that post is awesome, ClouD, I don't think you answered my question.

      You know when you contract the window size and the content/text re-arranges? There is "fixed width" which fixes this so it doesn't move while the window is re-sized. I can only find that option so far in the templates, but not as a command/code yet.

    21. #21
      Amateur WILDer
      Join Date
      Apr 2006
      Posts
      978
      Likes
      12
      You really need to start to basics.

      Here's some code that will allow for scroll bars.

      HTML Code:
      <div style="display:block; width:500px; height:500px; overflow:scroll;">
      <img src="/..." alt="" />
      </div>
      Any image larger than your set height and width will have a scroll bar show up. If you only want it scroll in the x/y direction, change overflow:scroll to either overflow-x:scroll or overflow-y:scroll depending on how you want it to scroll. The display:block is not really necessary since I have defined height and width, but I'm so used to throwing it in everywhere that I just put it in anyway.

      It's good practice to:

      A) Define width and height in some sort units, like pixels above.
      B) Avoid using tables to format.
      C) Link all CSS to a CSS file instead of using style="..." in the div tags like I did in the code above.
      Last edited by blade5x; 10-06-2008 at 04:10 AM.

    22. #22
      Eprac Diem arby's Avatar
      Join Date
      May 2006
      LD Count
      i/0
      Gender
      Location
      Canada
      Posts
      1,957
      Likes
      52
      Quote Originally Posted by blade5x View Post
      You really need to start to basics.
      QFT

      Goto w3schools

    23. #23
      Member really's Avatar
      Join Date
      Sep 2006
      Gender
      Posts
      2,676
      Likes
      56
      Thanks everybody! Nice.

    24. #24
      Member really's Avatar
      Join Date
      Sep 2006
      Gender
      Posts
      2,676
      Likes
      56
      Quote Originally Posted by really View Post
      You know when you contract the window size and the content/text re-arranges? There is "fixed width" which fixes this so it doesn't move while the window is re-sized. I can only find that option so far in the templates, but not as a command/code yet.
      Basically, you can put all the text into a (1 col. 1 row) table, and type in a width for the table. That, on its own is "fixed", as the value.

    25. #25
      Veteran of the DV Wars Man of Steel's Avatar
      Join Date
      Mar 2007
      LD Count
      ~35
      Gender
      Location
      Houston, TX
      Posts
      4,553
      Likes
      94
      Using a fixed-width div would accomplish the same thing, and be far less complex and use less code. Simply define the width of the div in your CSS file. W3Schools.com has all the info you need, and honestly, you're better off just messing around with it until you've got a good grasp of the different CSS dfinitions.

    Page 1 of 2 1 2 LastLast

    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
    •