codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  ASP communication with server drive and network folder  wenzation at 07:28 on Friday, September 05, 2003
 

Hi ,

I'm currently developing an intranet server with a search engine that searches through the server drive provided by a company .

The ICS department has provided me with a network folder for development of this intranet web. However there is no mapping path between this network folder and the server drive ( woxapp06 - K:\ ).

I've approached using filesystemobject to search through the local drive (K:\), however there is an error stating that K:\ is a physical mapPath, so I tried replacing the K:\ to woxpp06. However, it's an invalid path.

So I thought of trying using IIS, so i approached the ICS department again for the IIS. They told me this is not the right way to solve this problem, because if this method is applied, user who searches using this search engine will have to look through the network folder's K:\ before going into the woxapp06 to search for the specific file. So, they told me to programme the search engine in such a way so that it goes directly to the server drive instead of going over to the network folder's K:\ . But i got no idea how this thing can go about. It should be something regarding the ASP codings.

Willing to take any advice, thanks in advance.



  Re: ASP communication with server drive and network folder  Troy Wolf at 15:09 on Friday, September 05, 2003
 

Help me understand the details. So you will have an IIS webserver running your ASP application. On what machine is the "local" harddrive that you want to search?

o Same server that IIS is running on.
o Server on the same LAN with the IIS server.
o Local harddrive of the user's computer that is accessing the website.
o Any remote computer that the user specifies via a form on the website.

Troy Wolf: site expert
SnippetEdit Website Editor


  Re: ASP communication with server drive and network folder  wenzation at 01:43 on Monday, September 08, 2003
 

Help me understand the details. So you will have an IIS webserver running your ASP application. On what machine is the "local" harddrive that you want to search?

o Same server that IIS is running on.
o Server on the same LAN with the IIS server.
o Local harddrive of the user's computer that is accessing the website.
o Any remote computer that the user specifies via a form on the website.

Hi Troy wolf, thanks for replying me.

Ok, there is no more IIS used because the network folder itself can run my ASP application already. The intranet application that i'm programming currently is used by users on the intranet. No outsiders except staff in the company's LAN can access into this intranet website.

o Two different servers, woxapp06 - K:\ & amsweb02(network folder)
o Server on the same LAN with network folder
o Local harddrive(K:\) of user's computer is mapped from woxapp06 through the LAN to access the website.
o Only staff in the LAN can access.

Troy Wolf, is there anyway ASP programming can connect to a server(woxapp06)?



  Re: ASP communication with server drive and network folder  Troy Wolf at 14:13 on Monday, September 08, 2003
 

Wenzation, I'm confused by your reply. You mention "no more IIS used because the network folder itself can run my ASP application already". How can you process ASP code without a webserver?

What EXACTLY do you want to do? Yes, you can work with the file systems of other servers on your LAN -- as long as the webserver (the machine processing the ASP code) has user privileges to access those remote drives and folders.

I may not be the best person to assist with your specific situation, but I'll keep trying.
Troy Wolf: site expert
SnippetEdit Website Editor


  Re: ASP communication with server drive and network folder  wenzation at 01:56 on Tuesday, September 09, 2003
 

Hi Troy Wolf, no IIS used because the network folder itself already served as a webserver provided by the LAN.

i'm developing an intranet server with a search engine that searches through the server drive provided by a company .
What i want to know now is how to i actually connect the two servers together using ASP codings if possible. Then after that i need to search through the server drive for files. Is it possible?
*Note: I have privleges to access those remote drives and folders.

Thanks for trying for me!


<Added>

i'm developing an intranet website with a search engine that searches through the server drive provided by a company .


  Re: ASP communication with server drive and network folder  Troy Wolf at 02:54 on Tuesday, September 09, 2003
 

I have to admit, I'm still a tad confused by your exact situation, BUT, here is some code that may be what you are looking for. This is working ASP/VBScript code that will enumerate the folders and files in the webserver's root folder. The folder to look at is set at the top of the code. You could modify this folder path to be any full path on your LAN. For example:

C:
K:\music
\\127.0.0.1\files

Save this code as a new ASP file, then navigate to it to see it run. It will show a list of folders and files in your webserver's root.
<%
rootFolder = Server.MapPath("/index.html")
set filesys = server.CreateObject("scripting.filesystemobject")
set folder = filesys.GetFolder(rootFolder)
set subfolders = folder.SubFolders
set files = folder.Files
folderCount = subfolders.Count
fileCount = files.Count

Response.Write("<table>" & vbcrlf & _
"<tr>" & vbcrlf & _
"<th>Folder Name</th>" & _
"<th>Size</th>" & _
"<th>Modified Date</th>" & _
"</tr>" & vbcrlf)

for each subfolder in subfolders
sizeWrk = Round(subfolder.Size / 1024,0)
if sizeWrk < 1 then sizeWrk = 1
sizeWrk = formatnumber(sizeWrk,0) & " KB"
Response.Write("<tr>" & vbcrlf & _
"<td>" & subfolder.Name & "</td>" & _
"<td>" & sizeWrk & "</td>" & _
"<td>" & subfolder.DateLastModified & "</td>" & _
"</tr>" & vbcrlf)
next

Response.Write("</table><hr>" & vbcrlf)

Response.Write("<table>" & vbcrlf & _
"<tr>" & vbcrlf & _
"<th>File Name</th>" & _
"<th>Size</th>" & _
"<th>Modified Date</th>" & _
"</tr>" & vbcrlf)

for each file in files
sizeWrk = Round(file.Size / 1024,0)
if sizeWrk < 1 then sizeWrk = 1
sizeWrk = formatnumber(sizeWrk,0) & " KB"
Response.Write("<tr>" & vbcrlf & _
"<td>" & file.Name & "</td>" & _
"<td>" & sizeWrk & "</td>" & _
"<td>" & file.DateLastModified & "</td>" & _
"</tr>" & vbcrlf)
next

Response.Write("</table><hr>" & vbcrlf)
%>


It would be nice to be able to maintain indention when pasting code examples, but you can reformat this code and see how it works.
Troy Wolf: site expert
SnippetEdit Website Editor









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  code for downloading target file
•  Re: Mouseover Text Change
•  Open a Modal Pop Up From a LinkButton In a GridView
•  I need to know if the user close the browser or to open the window – browser without or with a disable close window button – How can I???
•  Re: SQL Plus Question
•  Need Menu Control that can come from side also...
•  Command and control application using Sphinx 4
•  Re: Print and print preview file on the website without using the File - Print on the IE
•  Table dynamique (datafld and title)


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2009