Click Here

PC Magazine

  PC Tech

Server-Side JavaScript

Introduction

Why Server-Side JavaScript?

The Architecture

Diagram: How LiveConnect Works

Session Management

File and Mail Services

Database Access

Accessing Other Languages



Click here for great long-distance rates!

FREE investing information on 400 top companies - click here!

 
  Categories
World Wide Web

Server-Side JavaScript
File and Mail Services

Continued from Session Management

File System Service lets you store persistent data and manipulate files. The File object is not intended for working with databases but is very useful when you need an easy-to-use data-storage solution. You use File to read, write, and search for files on the application server. You can't use File to work with files on the user's system.

File can work with both ASCII text and binary-formatted files, but reading and writing ASCII is much easier, because you can read and write data line-by-line or use strings. With binary files, on the other hand, you must break strings down into individual characters before you read or write. These individual characters are one byte in length and must be converted to a numeric value for reading and writing.

Mail Service consists of the SendMail object; you use it to generate mail messages within server-side JavaScript applications. The term SendMail may remind you of the Unix process used to generate mail messages, but the SendMail object is available for both Windows and Unix environments. SendMail lets you send multimedia such as images, sound files, and videos and also supports the multipart message syntax, which lets you send messages with attachments.

Once you create an instance of SendMail, you can use its properties to determine the fields used in your e-mail messages, how content is encoded, and where the message is sent. Generally, properties of SendMail correspond to actual fields in the e-mail message. For example, you use the To property to name recipients and the From property to name the sender.

SendMail directly supports the general fields used with standard SMTP servers, so you can create properties for custom fields as well, and then use these fields with custom mail servers or clients. Because custom fields are sent in the message header, they are generally subject to the restrictions of RFC 822, the specification that defines the standard for Internet messages (which states that all user-defined fields should have the prefix X-).

Next: Database Access

Published as PC Tech Feature in the 5/4/99 issue of PC Magazine.

Related Links
JavaScript-powered Stylesheets -- PC Tech
DHTML That Works in Both IE and Navigator -- PC Tech
JavaScript -- DevHead
ScriptHead Archive -- DevHead
 
JavaScript Programming Courses -- ZDU

 
 SPONSORED LINKS
QUANTUM  Storage solutions to count on 24 hours/day, CLICK HERE
Sprint  FrameRelay: See why users rate Sprint #1 for frame relay
Beyond.com  Click here for free software!
Software  X10.com -- The SuperSite for Home Automation
Books  Buy a gift for MOM, a book from barnesandnoble.com
 ZDNET FEATURED LINKS
Freebies!  The latest FREE files - yours to download and keep!
Shop Smart  Compare prices on over 7,000 computer products & save
Contest  Win a Diamond MP3 Rio from ZDNet Auctions!
 MAGAZINE OFFERS
Free Issue  Get a risk-free issue of RED HERRING magazine today!

TOP
Copyright (c) 1999 Ziff-Davis Inc.