BASE HREF details needed

Posted on 1998-01-08
Last Modified: 2010-05-19
I want to specify base href in an online .html file.  Specifically, I want to set base href to a local (hard drive) folder, which visitors can download from the net as a self-extracting archive.
What I need is the EXACT format for the tag (BASE HREF=?????????)  <BASE HREF=?????????>.
FYI  I have a routine in place which extracts the path from a cookie, and writes the BASE HREF tag using JavaScript.
Question by:boatful

Expert Comment

ID: 1842427
The format is : <BASE HREF="">

Author Comment

ID: 1842428
Sorry but I can't accept this answer, Sandburg, because (as I said)  I need to set BASE HREF to a LOCAL folder (i.e. on the user's hard drive).  I presume the format would be something like <BASE  HREF='file:///C|/Download/'>, but I posted the question to get precise guidance on formatting the tag.

Expert Comment

ID: 1842429
the base href you type : <BASE HREF="file:///C|/Download/"> is right for a base href to a folder on the hard-drive
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.


Author Comment

ID: 1842430
For NN it's <BASE HREF="file:///C|/www/trybaseh.htm">
For MSIE it's <BASE HREF="file:C:www/trybaseh.htm">

I answered my own question. What do you know????

Expert Comment

ID: 1842431
both MSIE and NN support file:/// and then the exact path, where : is converted to | and backslashes become slashes.
The more recent versions of MSIE and NN accept the standard DOS format, as well - but older versions accept the file:///C|... only.


Expert Comment

ID: 1842432
you can't use "<BASE HREF=>" on a local disk.
you have to move your files to a server.

Author Comment

ID: 1842433
You most certainly CAN set base href to a local disk.  I have a self-extracting zip archive available to my online clients, so that 400 kb or so of graphic and htm files download and unzip to their hard drive.  The target directory name is stored in a cookie, so whenever they visit the WWW site the parent frame reads the cookie and sets base href to the correct local directory.  As of today I have this working flawlessly in NN and MSIE.  The comments from Christian W. were most helpful and  I would like him to have the points.

Expert Comment

ID: 1842434
You *can* set the BASE HREF to a local file location, but it's pretty haphazard because not all users' hard drives will be configured similarly.  Your page will only  "work" on a certain platform and OS, and then only if the user has a "standard" configuration (hasn't done any custom installs).

Since you really can't control the file structure of users' drives, and since very few users will have a specific "fingerprint," it's not advisable.

Expert Comment

ID: 1842435
You didn't say why you needed this.  Seems to me as long as all your links and image references are relative, it doesn't matter where they extract the archive.

Author Comment

ID: 1842436
Regarding the comment from JShamlin,
Is there a way in Java or JavaScript to test for the client's operating system (ie WIN or W95, etc)??  I feel confident that the script I've written for saving BASE HREF of the local directory in a cookie in the WINDOWS environment works!  If there's a way to screen for OS, I can warn those non-windows OS client's that the batch download is not guaranteed to work.

Author Comment

ID: 1842437
Regarding the question from gwalters,
The reason for offering a batch download of graphic and htm files called at various times into various frames of the parent document (on the server) is to save time for frequent users of the site.  If you want to check out how it works, the URL is
I would love it if some of you would try the batch download option (called 'TURBO') and let me know how it works on your system!

Accepted Solution

Intel earned 50 total points
ID: 1842438
"<BASE HREF="c:\directory" will do just fine.

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Set email body to html using vbscript 6 41
How to make a moving character 3 51
Change Background Color of Website 5 14
Outlook opens HTML email as text 4 21
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now