Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Jun 18th, 2005, 12:02 PM   #1
Intimidat0r
Hobbyist Programmer
 
Intimidat0r's Avatar
 
Join Date: May 2005
Location: Don't know, but the padded walls are a nice touch.
Posts: 126
Rep Power: 0 Intimidat0r is an unknown quantity at this point
Send a message via ICQ to Intimidat0r Send a message via AIM to Intimidat0r Send a message via MSN to Intimidat0r Send a message via Yahoo to Intimidat0r
writing files in asp

Okay, here's the problem. When I try to go to the page with the ASP code, it says

Server.MapPath() error 'ASP 0174 : 80004005'

Invalid Path Character(s)

/goldteam/confirm_write.asp, line 9

An invalid '/' or '\' was found in the Path parameter for the MapPath method.

Here's the code:
<% Option Explicit
Dim FileName
FileName = "teachers/" & Request.QueryString("teacher") & "/announcements.txt"
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim FSO
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Dim FilePath
FilePath = Server.MapPath(FileName)
If FSO.FileExists(FilePath) Then
Dim File
Set File = FSO.GetFile(FilePath)
Dim Filesize
Filesize = File.size
Dim Textstream
Set Textstream = File.OpenAsTextStream(ForWriting, TristateUseDefault)
Dim Line
Dim Contents
Contents = Request.QueryString("txtAnnouncements")
TextStream.Write(Contents)
Set TextStream = Nothing
Else
Response.Redirect("file_error.asp?teacher=" & Request.QueryString("teacher"))
End If
Set FSO = Nothing
%>

in the url, it's passed a variable with the ? which i know im doing correctly. the idea is if it's pagename?teacher=bob then the file is supposed to be teachers/bob/announcements.txt which is done on line 3. does anybody know how i can fix the error?
__________________
Children in the dark cause accidents, and accidents in the dark cause children.

http://www.ronincoders.org
Intimidat0r is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:54 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC