Solved

Creating Files and Folders in ASP

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Make Line Items Look Good Over Mobile 2 101
Weighted Randomizing 6 33
Executing a script on a timer online 5 32
Clear input text 15 26
Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

749 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