Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PATH for CreateTextFile

Posted on 2004-10-18
5
Medium Priority
?
244 Views
Last Modified: 2008-07-03
Hello Experts!


I am creating a .txt file in ASP using this;

CreateObject("Scripting.FileSystemObject")
CreateTextFile("c:\somefile.txt")

...I am on a webhotel though and need to make the path like if so;

"/texts/group1/text1.txt"

What then would be like; "www.mysite.com/texts/group1/text1.txt"

How do I do that??

Thank you!

/Jens
0
Comment
Question by:Jens979
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 13

Expert Comment

by:nurbek
ID: 12337630
Use Server.MapPath() method

like

Server.MapPath("texts/group1/text1.txt")
0
 

Author Comment

by:Jens979
ID: 12337672
Thank you!
I still have a small problem.

how do I write the entire line?

Set tfile=fs.CreateTextFile Server.MapPath("texts/group1/text1.txt")

Gives me an error.

How is the right way??

/Jens
0
 
LVL 6

Expert Comment

by:masirof
ID: 12337710
Where is your file which should create file?
/texts/  ?? or some other directory..

for example if you are here

root/
        file.asp
and text file should be created here
root/texts/group1/text1.txt

Set tfile=fs.CreateTextFile Server.MapPath("texts/group1/text1.txt") this should work..

if other you can use ../ etc to point to right place,

and anyway, which error it does give? path not found?
0
 
LVL 13

Accepted Solution

by:
nurbek earned 500 total points
ID: 12337721
Use paranthesis

Set tfile=fs.CreateTextFile(Server.MapPath("texts/group1/text1.txt"))

also give the write permission to group1 folder

0
 
LVL 6

Expert Comment

by:masirof
ID: 12337734
zigeyin dese :))
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question