Getting script to execute - Publish to WebServer

Results 1 to 2 of 2

Thread: Getting script to execute - Publish to WebServer

  1. #1
    M. Bush Guest

    Default Getting script to execute - Publish to WebServer

    There are some questions about ASP that I cannot find answers to. To begin, I&#039m using NotePad as a text editor and Microsoft Personal WebServer 4.0. Initially, my understanding was that once you had written your HTML and script, all you had to was to save the file as a text file with an ASP extension in the home directory on your hard drive. Then, if Personal WebServer homepage pointed to the folder on your C drive and the default file was specified all you had to do to view the ASP file using your Browser. Imagine to my surprise that the script was not executed! Since then I&#039ve learned that unless the file in your Homepage directory on the hard drive is PUBLISHED to your WebServer it will not execute the script. This has raised the following questions that are driving me crazy:<BR><BR>What is meant by "PUBLISHED" and Web Server?<BR><BR> First, does Web Server mean hardware or the software? My guess is that the reference is software since MS Personal WebServer software and web files resides upon the same PC and trying to execute the ASP file from the hard drive without being PUBLISHED does not work..<BR><BR> Second, does PUBLISHED mean a File Upload and if so where does this file reside?<BR><BR> Is the file marked/tagged in some way within the WebServer application so that the WebServer software components execute the script?<BR><BR> Is the script within the file compiled into executable code that is recognized by the WebServer software?<BR><BR> Is this a true file upload to the WebServer Application and if so, where does the file reside and how can you view it?<BR><BR> Do you have to use a vendors software (e.g. FrontPage, SA-FileUp, etc.) to PUBLISH and if not could you please also comment on the following:<BR><BR> When using a form to upload files, the following items must be set:<BR>1. The FORM must have a tag of ENCTYPE="multipart/form-data". <BR>2. The &#060;INPUT TYPE="FILE"&#062; must have a tag of NAME= . <BR>This tells the browser to transmit the contents of the file when posting the form.<BR>Let&#039s look at the form&#039s processing (formresp.asp). The following line creates an instance of the SA-FileUp object:<BR> &#060;% Set upl = Server.CreateObject("SoftArtisans.FileUp") %&#062;<BR>The following line invokes the .SaveAs method and passes the name of the web server&#039s destination file as a parameter.<BR> &#060;% upl.SaveAs "C: empupload.out" %&#062;<BR><BR>In two lines you&#039ve uploaded a file! ?????? TO WHERE AND WHAT CAUSES THE SCRIPT TO BE INVOKED ?????<BR><BR>Can someone please tell me what is going on?<BR> <BR>

  2. #2
    rajit Guest

    Default RE: Getting script to execute - Publish to WebServ

    well, everything now sounds like a conundrum. i am not a guru, but i will try to put this in the most comprehensible fashion. <BR><BR>- think of a big computer which is kind of like a mother computer with all kinds of additional capabilities to perform specific tasks. This could be branded as "Server". Let us assume this server has all kinds of libraries to perform actions that you need. an example of this is PWS, IIS, Java Web Server, MTS, Netscape server, etc......<BR><BR>- consider the above server as a web server. In our case, since we are considering ourselves a MS savvy guys let us say this server is PWS (personal web server - a MS web server - a smaller version of IIS). This means this server (hardware machine) has all the software and liberaries to act as a Web server. Any machine can be a server, but will act as a web server only if you have all the software components and other supporting run time files installed. You can goto sun web site and download a java web server package for free and install it on a machine and now that machine is java web server. If you think in terms of internet, there is going to be a huge load on these machines in a commercial applications. So typically, your mother server computer will act as either MS web server or Java web server, or Apache server depending on the business requirements.<BR><BR>- the architecture is, there is a web server and now you want to use a certain feature of that server. So you write code in your html file. when somebody opens this html file on their browser, most of the code is executed in individual browser (IE or Netscape). But if in your code you want to implement a feature that can be availed from a web server, then you exclusively ask the code to run in server. In this case your server should be compatable to understand your request. This is how your request and response gets activated.<BR><BR>- typically if you have piece of code in your html file that needs to be executed on MS IIS web server, then you name the file as .asp file and use these tags "%" to run on the server machine.<BR><BR>- now where does this PUBLISHING come into picture! when you say publishing, all that you are doing is copying your html or asp file into proper file folders in the web server. this kinds of brings us into url structure. when you type, that means the client is accessing a file (default.html or index.html or .asp) from the parent directory assigned to this url. When one types ---&#062; this means cleint is trying to access the file "123.asp" from abc folder under the main parent folder. How can a user access these file from some remote machine. When you installed your server and necessary web server package, ther is a default interface you are implementing called IUSR_(username) which will let any user to access these files. Beyond that directory structure, users can&#039t access any files.<BR><BR>- these days technologies like COM became very prominent. What does this mean? We talked about all these great features your web server provides. That is the reason, you wrote code in your .asp file to run on the server since client browser dosn&#039t have those features. Now what you could do is write all these complex business rules in either VB or VC++ and then compile them as a dll. Then register that dll in the web server. When you did that, guess what! you actually added an other feature to the web server. This means any of your .asp file can use (implement this interface) this obejct and perform all these complex activities. To use these objects in your code you typically use server.createobject("") syntax within the tags"%".<BR><BR>- remember: when accessing any files on the server, you can&#039t refer to hardcoded paths like C:abcyzy.htm; you have to use relative paths. This is because user has access to main public folder and anything under that only. When you say c:something, people can&#039t access that since they don&#039t have permission.<BR><BR>Hope this is helpfull. If you need more info, grab on of books.......

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts