Solved

Creating Files and Folders in ASP

Posted on 2007-04-10
4
153 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 500 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

623 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