9 Replies Latest reply on Aug 7, 2007 7:44 AM by Newsgroup_User

    iframe src="someFile.csv"

    stewg76
      Hello. I have an external .csv file that get rendered into a html page as so...




      Does anyone know how to make it show up in a table {tabular?} on the page?
      Any help would be greatly appreciated.
        • 1. Re: iframe src="someFile.csv"
          Level 7
          A *.csv file is a file with values separated by commas. To make those
          values appear in an HTML table, you would have to explicitly build the page
          containing the table and the values.

          You cannot just link to a CSV file and have it magically become an HTML
          page.

          --
          Murray --- ICQ 71997575
          Adobe Community Expert
          (If you *MUST* email me, don't LAUGH when you do so!)
          ==================
          http://www.dreamweavermx-templates.com - Template Triage!
          http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
          http://www.dwfaq.com - DW FAQs, Tutorials & Resources
          http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
          ==================


          "stewg76" <webforumsuser@macromedia.com> wrote in message
          news:f90no5$m5k$1@forums.macromedia.com...
          > Hello. I have an external .csv file that get rendered into a html page as
          > so...
          >
          >
          >
          >
          > Does anyone know how to make it show up in a table {tabular?} on the page?
          > Any help would be greatly appreciated.
          >
          > <table width="800" border="0" cellspacing="0" cellpadding="0">
          > <tr>
          > <td><iframe src="someFile.csv" width="100%" height="100%">
          > </iframe> </td>
          > </tr>
          > </table>
          >

          • 2. Re: iframe src=&quot;someFile.csv&quot;
            Level 7
            Given OP's skill level, could he open csv file in excel and save as an html
            page for his iframe?


            "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
            news:f92iju$pdi$1@forums.macromedia.com...
            >A *.csv file is a file with values separated by commas. To make those
            >values appear in an HTML table, you would have to explicitly build the page
            >containing the table and the values.
            >
            > You cannot just link to a CSV file and have it magically become an HTML
            > page.
            >
            > --
            > Murray --- ICQ 71997575
            > Adobe Community Expert
            > (If you *MUST* email me, don't LAUGH when you do so!)
            > ==================
            > http://www.dreamweavermx-templates.com - Template Triage!
            > http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
            > http://www.dwfaq.com - DW FAQs, Tutorials & Resources
            > http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
            > ==================
            >
            >
            > "stewg76" <webforumsuser@macromedia.com> wrote in message
            > news:f90no5$m5k$1@forums.macromedia.com...
            >> Hello. I have an external .csv file that get rendered into a html page as
            >> so...
            >>
            >>
            >>
            >>
            >> Does anyone know how to make it show up in a table {tabular?} on the
            >> page?
            >> Any help would be greatly appreciated.
            >>
            >> <table width="800" border="0" cellspacing="0" cellpadding="0">
            >> <tr>
            >> <td><iframe src="someFile.csv" width="100%" height="100%">
            >> </iframe> </td>
            >> </tr>
            >> </table>
            >>
            >


            • 3. Re: iframe src=&quot;someFile.csv&quot;
              Level 7
              Perhaps, yes.

              --
              Murray --- ICQ 71997575
              Adobe Community Expert
              (If you *MUST* email me, don't LAUGH when you do so!)
              ==================
              http://www.dreamweavermx-templates.com - Template Triage!
              http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
              http://www.dwfaq.com - DW FAQs, Tutorials & Resources
              http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
              ==================


              "Ken Binney" <kenbinney@ossiningdesignguild.com> wrote in message
              news:f92s0g$5t7$1@forums.macromedia.com...
              > Given OP's skill level, could he open csv file in excel and save as an
              > html page for his iframe?
              >
              >
              > "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
              > news:f92iju$pdi$1@forums.macromedia.com...
              >>A *.csv file is a file with values separated by commas. To make those
              >>values appear in an HTML table, you would have to explicitly build the
              >>page containing the table and the values.
              >>
              >> You cannot just link to a CSV file and have it magically become an HTML
              >> page.
              >>
              >> --
              >> Murray --- ICQ 71997575
              >> Adobe Community Expert
              >> (If you *MUST* email me, don't LAUGH when you do so!)
              >> ==================
              >> http://www.dreamweavermx-templates.com - Template Triage!
              >> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
              >> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
              >> http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
              >> ==================
              >>
              >>
              >> "stewg76" <webforumsuser@macromedia.com> wrote in message
              >> news:f90no5$m5k$1@forums.macromedia.com...
              >>> Hello. I have an external .csv file that get rendered into a html page
              >>> as so...
              >>>
              >>>
              >>>
              >>>
              >>> Does anyone know how to make it show up in a table {tabular?} on the
              >>> page?
              >>> Any help would be greatly appreciated.
              >>>
              >>> <table width="800" border="0" cellspacing="0" cellpadding="0">
              >>> <tr>
              >>> <td><iframe src="someFile.csv" width="100%" height="100%">
              >>> </iframe> </td>
              >>> </tr>
              >>> </table>
              >>>
              >>
              >
              >

              • 4. Re: iframe src=&quot;someFile.csv&quot;
                stewg76 Level 1
                On a mac using firfox 2.0 it renders the CSV file as a coma seperated value inside what looks like a typical form text field, But on a PC using IE it prevents the page from opening and only allows to save the CSV that then gets opened up in excell. To be honest I an new to this iFrame thing. It renders for me on a mac, but the rest it is only able to save.
                • 5. Re: iframe src=&quot;someFile.csv&quot;
                  Level 7
                  On Mon, 6 Aug 2007 19:48:05 +0000 (UTC), "stewg76"
                  <webforumsuser@macromedia.com> wrote:

                  >On a mac using firfox 2.0 it renders the CSV file as a coma seperated value
                  >inside what looks like a typical form text field, But on a PC using IE it
                  >prevents the page from opening and only allows to save the CSV that then gets
                  >opened up in excell. To be honest I an new to this iFrame thing. It renders for
                  >me on a mac, but the rest it is only able to save.

                  It has nothing to do with the iframe. The iframe is only going to make
                  it more complex. The only reliable method of doing this is to use a
                  server side script to parse the comma separated values and display them,
                  probably in a table.
                  • 6. Re: iframe src=&quot;someFile.csv&quot;
                    stewg76 Level 1
                    That sounds like the right answer, do you know of one such script?
                    Preferably Open Source ie. FREE
                    • 7. Re: iframe src=&quot;someFile.csv&quot;
                      Level 7
                      On Mon, 6 Aug 2007 22:34:20 +0000 (UTC), "stewg76"
                      <webforumsuser@macromedia.com> wrote:

                      >That sounds like the right answer, do you know of one such script?
                      >Preferably Open Source ie. FREE

                      It's pretty trivial to do. What server scripting language(s) can be used
                      on the server?
                      • 8. Re: iframe src=&quot;someFile.csv&quot;
                        stewg76 Level 1
                        It is hosted on an apache server.
                        • 9. Re: iframe src=&quot;someFile.csv&quot;
                          Level 7
                          On Tue, 7 Aug 2007 11:49:48 +0000 (UTC), "stewg76"
                          <webforumsuser@macromedia.com> wrote:

                          >It is hosted on an apache server.

                          That doesn't answer the question about what scripting languages you can
                          use. Given that it's an Apache server, you *probably* have PHP
                          available. Here's a quick example:

                          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
                          " http://www.w3.org/TR/html4/strict.dtd">
                          <html>
                          <head>
                          <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
                          <title>Display CSV File Demo</title>
                          </head>
                          <body>
                          <?php
                          $file="filename.csv";
                          if(file_exists($file) && is_readable($file)){
                          if($fp=fopen($file,'r')) {
                          if($line=fgetcsv($fp)) {
                          print "<table>\n";
                          do {
                          print "<tr>";
                          foreach($line as $cell){
                          print "<td>$cell</td>";
                          }
                          print "</tr>\n";
                          }while($line=fgetcsv($fp));
                          print "</table>\n";
                          }
                          }else{
                          print "Failed to open file";
                          }
                          }else{
                          print file_exists($file)?
                          "File $file is not readable":
                          "File $file does not exist";
                          }
                          ?>
                          </body>
                          </html>

                          Note that you'll need to change the $file="filename.csv"; line to
                          replace filename.csv with your actual file name.