Solved

Creating Files and Folders in ASP

Posted on 2007-04-10
4
147 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)
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Age between date range query (SP) 13 50
JSON error 4 50
WCAG (Web Content Accessibility Guidelines) levels 3 66
Issues with Insert statement 12 6
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

914 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now