In this example we open a file which is in this case called sampletext.txt . This file contains several lines which we wish to display , so we loop the lines of text one at a time and display them until there are none left to display
Reading XML file with ASP. ASP / XML and ASP
XML stands for Extensible Markup Language. XML can be used in many ways and one of which is 'data storage'. This is the one we will be exploring in this article.
File Object ASP / File Operations
The File object represents a specified file on the local machine or on a network share. To work with the File object's properties and methods, you need to create an instance of the FileSystemObject object first and then instantiate the File object through the GetFile method. Also you can get a File object reference from the Folder object, by using the Files Collection.
Create Excel on the Server ASP / Excel and ASP
Active Server Pages allow for the easy ability to create dynamic views of your data on a web server, but you can also create word and excel documents on the server. This can be particularly useful if you wish to distribute your information on CD or in document form.The following example will utilize our state info db. After reading the contents of the db instead of writing output to the browser html text is written to the server with the .xls file extension.
Check the file before to delete ASP / File Operations
We continue to examine file system object in this sample code. Most common ASP problems are trying to modify a file before checking it exists. Probably you have moved this page to delete it before. So we must check that this file is exist or not.
Import CSV to HTML ASP / File Operations
A CSV (Comma Separated Values file sometimes referred to as a flat file) is essentially a text file that has a comma delimiter between the table values and a unique line for each observation. While this is usually a means by which data is transferred from one database to another by itself can be used as input to an asp document. The following example will take virtually any CSV file and write it to an html table.
Creating Excel Files Online ASP / Excel and ASP
ASP has the ability to dynamically output any kind of office application format. Before to start coding, The first thing we need to do is set correct file type. Becase the browser needs to know what to do with the file. Second step is to edit file name. You can use HTML and CSS to create styles in your word document.
Creating Word Files Online ASP / Word and ASP
ASP has the ability to dynamically output any kind of office application format. Before to start coding, The first thing we need to do is set correct file type. Becase the browser needs to know what to do with the file. Second step is to edit file name. You can use HTML and CSS to create styles in your word document.
Understanding File Upload ASP / File Operations
Building an upload file mechanism on a Web server can often require using a costly DLL. Tiago Halm's article shows you how to upload a file using only Active Server Page (ASP) code and Internet Explorer.
Dynamic Javascript Includes ASP / Miscellaneous
Dynamically include javascript files in your page. Simply place all your javascripts in a sub directory and make one reference in your page to the cs_scripts.asp file. You can then pass + or - with file names to either include or ignore a file in the sub directory.
Simple Text Counter ASP / Counters
This example is a simple text based counter that will only show page views, not actual visitors. It uses the File Scripting Object to interact with a text file. It first reads the current number in the file and adds one to it, then displays it as text on the page.
Checking Files Exists ASP / File Operations
If you want to check a file exists, you may use this code. First we are starting script creating a copy of File System Object. FSO has many useful methods.
404 Error Page (CDONTS) ASP / Debugging and Error Handling
The basic 404 error or file not found page serves two specific purposes. Firstly, to alert the user that the item they were expecting is not currently available, rather than the generic page your host may provide or worse the generic windows file not found page. Secondly, to alert the webmaster that a file is missing or a link is targeting something incorrectly.
Searching Drives, Viewing and Downloading Files ASP / File Operations
This article illustrates some great uses of the File System Object. It shows how to choose a drive to search, and then builds a listbox of all the folders on that drive. Choose a folder and it builds a listbox of all the files in that folder. Choose a File and it will display it in the browser or prompt you to save the file to your hard drive.