English Deutsch Français Italiano Particle Software Buy Now


Particle Software
 
Get File List
   ..::   About  •  Purchasing  •  Search  •  Contact  • Home   ::..
 
Screenshots
• Sample
Downloads
Resources
• FAQ
• Macros

 
  Below shows how IntraLaunch can be used to obtain a list of files for a given path.

  This feature can be used to build a basic client side file manager with Javascript and DHTML. See the source code to this live working example for complete details for all features.

   Size values could be formatted with Javascript's " Math.round(sValues[3] / 1024) + ' KB' ". IntraLaunch version 5.0 or higher required.

  All drives/paths used for GetFiles() must have the backslash escaped. For example "G:\\" or "\\\\server.company.com\\Share".

  • GetFileList()



 
 
<HTML>

<SCRIPT LANGUAGE="JavaScript">
   function GetFiles(sFullPath, sFileType)
   {
     var sResult;
     var sValues;

     IntraLaunch.ResetFileList();

     while (sResult = IntraLaunch.GetFileList(sFullPath, sFileType))
     {
       sValues = sResult.split('|');
       // sValues[0] is File Name (file.ext)
       // sValues[1] is Full File Path (c:\path\file.ext
       // sValues[2] is File Type (File or Folder)
       // sValues[3] is File Size (3210)
       // sValues[4] is File Last Modified Date (12/20/2002 11:50 AM)

       alert ('Filename: ' + sValues[0] + ' Size: ' + sValues[3]);

       // Update a table dynamically, IE version below
       var newRow = document.all.FileManager.insertRow();
       var newCell = newRow.insertCell();
       newCell.innerHTML = 'File Name: ' + sValues[0] + ' Modified: ' + sValues[4];
     }
   }
</SCRIPT>

<BODY OnLoad="GetFiles('C:\\Path', '*.*');">

<table width=640 cellpadding=1 cellspacing=1 border=0 id="FileManager">
</table>

</BODY>

<OBJECT ID="IntraLaunch" STYLE="display : none" WIDTH=1 HEIGHT=1    CODEBASE="http://intranet.net/menu/IntraLaunch.CAB#version=5,0,0,0"
   CLASSID="CLSID:0AE533FE-B805-4FD6-8AE1-A619FBEE7A23">
   <PARAM NAME="ImageLoc" VALUE="Null">
   <PARAM NAME="ImageSrc" VALUE="Null">
   <PARAM NAME="Run" VALUE="Null">
   <PARAM NAME="RunParms" VALUE="">
</OBJECT>

</HTML>
 
 
       



Copyright © 1997-2008 Particle Software - All Rights Reserved
Web services provided by Extreme Hosting