JSP File system

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eeriehunk
    New Member
    • Sep 2007
    • 55

    JSP File system

    Hello, first of all I am not sure if i can post a JSP question here. I apologize if it’s not and please let me know where I could.
    Coming to the point, I recently developed a Javascript which accesses windows file system using activeX Object and it worked fine, but unfortunately I cannot copy this code on to UNIX server and run with a UNIX file system (UNIX file path in my code) and I also realized that java script cannot use file systems. So I have planned to rewrite my code using JSP to access the UNIX file system. I am not even sure if could accomplish this task with JSP. If it can be done please give me a start. If not what are my options using the java family.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by eeriehunk
    Hello, first of all I am not sure if i can post a JSP question here. I apologize if it’s not and please let me know where I could.
    Coming to the point, I recently developed a Javascript which accesses windows file system using activeX Object and it worked fine, but unfortunately I cannot copy this code on to UNIX server and run with a UNIX file system (UNIX file path in my code) and I also realized that java script cannot use file systems. So I have planned to rewrite my code using JSP to access the UNIX file system. I am not even sure if could accomplish this task with JSP. If it can be done please give me a start. If not what are my options using the java family.
    Yes you can ask JSP questions here (for now anyway).
    You can put any Java code in a JSP you can access the file System. Have a look at the code in this thread.
    The code is for copying files but it accesses the file sytem using the FileChooser

    Comment

    • eeriehunk
      New Member
      • Sep 2007
      • 55

      #3
      Originally posted by r035198x
      Yes you can ask JSP questions here (for now anyway).
      You can put any Java code in a JSP you can access the file System. Have a look at the code in this thread.
      The code is for copying files but it accesses the file sytem using the FileChooser

      Thank you for your reply. I am not sure if Jfilechooser would help me from what i am trying to achieve. But let me show you some thing
      I have this code which uses the Active Xobject and FileSystemObjec t to retrieve all the file names in a given folder/directory. So is there a similar code in java that I could run on Unix with unix path and filesystem.

      Code:
      var fs = new ActiveXObject("Scripting.FileSystemObject");
      function ShowHomeFolderContents(){
      	var f = fs.GetFolder(Server.MapPath("http:///pht025f3.pedc.sbc.com:7778"));
      	var fc = new Enumerator(f.files);
      	var path = " ";				
      
      	for (; !fc.atEnd(); fc.moveNext()) 
      				{ 
      					path = fc.item(); 
      					document.write(path+"<br>");					
      				} 	
      }

      Comment

      Working...