Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening files on a server

Status
Not open for further replies.

brood

IS-IT--Management
Dec 24, 2005
4
NL
I have an html page which uses vbscript to open a file from a server and display it (after being manipulated) in a frame. The problem is that the users specify which file they wish to view by entering the date of the file they're after (each file is named date.txt) but the script can't find the file. I use the same code when the file is local and it works fine but as soon as I put it on a server it no longer works. The file does exist on the server because if I put the entire address into a window (eg. appears. Is there a command/option that has to be used when dealing with servers?
 
Is there a permissions issue here? Mise Le Meas,

Mighty :)
 
If the file is on a server, then you'd need to use the mapping command in VBScript, and provide a username and a password in this command. If u have some code, that may make things clearer
 
Here's part of the code and permissions is not an issue.

SET FSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("Wscript.Shell")

SUB LOAD_FILE()
dim TempFileName
TempFileName = Inputbox("Enter Date of Filename (eg. 01/01/2001)","File Name", date)
FileName = MID(TempFileName,1,2) & MID(TempFileName,4,2) & MID(TempFileName,7,4)
MyPath = " FileString = MyPath & FileName & ".txt"

SET ReadFile = FSO.OpenTextFile(" & FileName & ".txt", 1, false)

Program then calls another routine to manuipulate the read text.

As a secondary problem, I receive errors if I do a statement like SET FSO = Wscript.CreateObject(...) saying "object required: 'wscript'. All the sample code I've seen has the wscript part included but if I include I get errors. Again, that's just a secondary issue.
 
try:
set FSO = CreateObject("Scripting.FileSystemObject")

 
i have a question.
what if you wanted to acheive this, but the opposite way?
like you have a server and you want to send the client
to a file?

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top