• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Files on the Web
 

Files on the Web

on

  • 387 views

Presentation for SUU Web Development course.

Presentation for SUU Web Development course.

Statistics

Views

Total Views
387
Views on SlideShare
387
Embed Views
0

Actions

Likes
0
Downloads
2
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Files on the Web Files on the Web Presentation Transcript

    • Files on the Web
      Presented by Brett Millett
    • Web Servers & File Systems
      IIS
      Windows
      We generally understand “Drives.”
      Path Separator: back-slash. C:Inetpubwwwroot
      Apache
      Unix-type file systems. Linux, FreeBSD, etc.
      Single hierarchy: Unix file systems are “virtual.”
      Path Separator: forward slash. /var/www
      The “root” of the file system indicated by /
    • Unix File Paths
      Example
      /var/www/widgets/pub_html
      <imgsrc=“images/mypic.png” />
      .myimages{ background: #fffurl(../images/img.gif) repeat-x fixed;}
      All web servers ,including IIS (Windows,) use same path convention to indicate path to resource.
    • Virtual Roots & Websites
      Websites begin in a “virtual” root.
      File system “real” path
      /var/www/widgets/pub_html/index.html
      Website “virtual” path
      http://www.widgets.com/index.html
      When referring to resources in our HTML, we can specify “root” using a forward slash, just like Unix file systems.
    • File Path Syntax & Meanings
      /images/pic.jpg
      Look for images directory in the root of file system.
      ../images/pic.jpg
      Go “up” one directory from current.
      images/pic.jpg
      images folder in current directory.
    • Website File Hierarchy
    • Absolute vs. Relative Paths
      Absolute path is the entire path from the website root.
      <imgsrc=“http://www.widgets.com/images/pic.jpg” />
      <imgsrc=“/images/pic.jpg” />
      Relative path is the partial path relative to the current directory.
      <imgsrc=“images/pic.jpg” />
      <imgsrc=“../images/pic.jpg” />
    • Relative Path Pitfalls
      Relative paths change when file’s context in a directory changes.
      <imgsrc=“images/sm_harts.gif” /> in index.htmlis not equivalent to <imgsrc=“images/sm_harts.gif” /> in subdirectory/thankyou.htm.
    • Relative Path Pitfalls
      The problem in the previous example can be solved by using the absolute path.
      <imgsrc=“/images/sm_harts.gif” /> in index.htmlis equivalent to <imgsrc=“/images/sm_harts.gif” /> in subdirectory/thankyou.htm.
    • Why to use Absolute Paths
      Server side includes
      Include files must work in any sub directory html document.
      Web application frameworks
      Apache rewrites & segment based URL emulate file structure only.
    • Questions & Answers