6 Replies Latest reply on Dec 27, 2006 11:05 AM by ntsiii

    create xml file

    phi2265 Level 1
      is it possible for me to automatically create an xml file based on a directory for populating a tile list. i need to make a new photo gallery and the only way i know how to display the photos is with a tile list and xml file... anyone have any other suggestions?
        • 1. Re: create xml file
          phi2265 Level 1
          if i could just get a list of the contents of a directory, i'd be good to go...
          • 2. Re: create xml file
            ntsiii Level 3
            You'l need server-side functionality to do this.

            You canot access anything on a client.

            Tracy
            • 3. Re: create xml file
              chris.huston.t10 Level 3
              Do you have access to PHP? If so, you can have PHP return a list of a given directory. The below code will return an xml list of files from a directory that you can specify. You can call this PHP file with an HTTPService or RemoteObject.

              $dir = $_POST['dir'];
              $file_list = scandir($_SERVER['DOCUMENT_ROOT'].$dir);
              $resultList .= "<files>";
              foreach ($file_list as $file_name) {
              if ($file_name != "." AND $file_name != "..") { //used to filter out the . and .. that come with the scandir function.
              $resultList .= "<file_name>$file_name</file_name>\r";
              }
              }
              $resultList .= "</files>";
              echo $resultList;

              Vygo
              • 4. Re: create xml file
                phi2265 Level 1
                nice.. that looks like its exactly what i need.. i'm gonna try it out when i get to the office in the morning. thanks a lot. i'll let you know how it goes.
                • 5. Re: create xml file
                  phi2265 Level 1
                  quote:

                  Originally posted by: Masamune
                  Do you have access to PHP? If so, you can have PHP return a list of a given directory. The below code will return an xml list of files from a directory that you can specify. You can call this PHP file with an HTTPService or RemoteObject.

                  $dir = $_POST['dir'];
                  $file_list = scandir($_SERVER['DOCUMENT_ROOT'].$dir);
                  $resultList .= "<files>";
                  foreach ($file_list as $file_name) {
                  if ($file_name != "." AND $file_name != "..") { //used to filter out the . and .. that come with the scandir function.
                  $resultList .= "<file_name>$file_name</file_name>\r";
                  }
                  }
                  $resultList .= "</files>";
                  echo $resultList;

                  Vygo


                  I don't have PHP language support with my domain, and I really dont want to get rid of ASP so that I can have it. Is it possible to translate this to ASP? I've been trying but haven't had much luck. Thanks.
                  • 6. Re: create xml file
                    ntsiii Level 3
                    It is certainly possible. ASP supports the filesystem functionality very well. I don't have any code handy.

                    Tracy