Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Creating Files and Folders in ASP

Posted on 2007-04-10
4
Medium Priority
?
156 Views
Last Modified: 2010-04-25
I have to create some 290 folders in the server and each folder should have a index.asp file.
I have table called 'Category' in an Access db. I want to create the folders for each value in the 'Cat' field of the table 'Category'. I can use 'FOlder Object' to create the folders, but how do i create these index.asp files and upload to the respective folders?
0
Comment
Question by:CWS (haripriya)
[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
4 Comments
 
LVL 8

Expert Comment

by:jawahar_prasad
ID: 18881811
0
 
LVL 8

Accepted Solution

by:
jawahar_prasad earned 2000 total points
ID: 18881856
This is the loop for your folder creation

<%
while not rs.eof
foldername=rs("cat")

' CREATE YOUR FOLDER HERE...

'IN THE SAME LOOP PASTE THE FOLLOWING CODE FOR CREATING index.asp FILE

Dim objFSO, objTextFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile(Server.MapPath("\"&foldername&"\index.asp"))
objTextFile.WriteLine "Put your content here..."
objTextFile.Close
Set objTextFile = Nothing
Set objFSO = Nothing

%>
0
 
LVL 16

Author Comment

by:CWS (haripriya)
ID: 18882001
thanx prasad, I will check and get back to you...
0
 
LVL 16

Author Comment

by:CWS (haripriya)
ID: 18889063
It works great....thank you so much...
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

705 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