Solved

Creating Files and Folders in ASP

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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…

758 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

19 Experts available now in Live!

Get 1:1 Help Now