Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I make a .asp file on the fly?

Status
Not open for further replies.

jakoye

Programmer
Jun 7, 1999
3
US
Is this even possible? I know you can make a text file, but can you create a file with a .asp extension through code???
 
Hello, i'm from spain and my english isn't very well<br>
I think that the difference in a txt file and a asp file is nothing because (a asp is a txt file). the only difference is the name of the file.<br>
<br>

 
Nod..alfmartin is right...all you do is write a code in Notepad then save it as "whatever.asp" and select in the format menu "all types" and it should work...
 
I guess I'll answer your question with a question. When you say "in code", what type of code are you talking about? Any language that can open a new file, save data to it, and close it with a particular file name can create a file with a .asp extention. Obviously if you are talking about doing this from an ASP page, the issues are more compicated. You'd need to create a file on the server using server side code, which I know can be done, although I haven't done it. I believe it is more work in ASP than in a standard language such as VB or C++. At any rate, if you want to be more specific, I can comment further. Hope that helps.
 
Previous replies assumed two interpretations of the question. Maybe the originator should clarify it! ASP is usually used to dynamically create Web page at the server side for a particular user based upon some given conditions/data. There are a number of things you can do too at the server side, including creating a file with .asp extension. But would that be a dangerous design for a Web site? You are dynamically creating a page which will in turn used to create another dyanmic page. I am curious to know the reason of doing that! <br>

 
Yes, you can do this. I have written a program entirely in ASP that publishes a web site consisting of ASP files. The purpose of this was that I also built an editing program for the marketing folks to use and change the pages. All data entered by them is entered into a database table, and the approved list of code (for a uniform look-and-feel) is used along with that data to generate the pages themselves.<br>
<br>
You need to read up on the FileSystemObject.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top