how to link files in a cd

Status
Not open for further replies.

hansraj

In the zone
I am planning to make a cd with various files i.e. doc, pdf, html, mht, txt, jpg with an index. But unable to link them for the cd. Linking on the hard disk with a complete path is a piece of cake but I am uanble to find the method to give a relative path for the cd.
I am making index in html.
 

dheeraj_kumar

Legen-wait for it-dary!
Use ./ and ../ for relative paths.

linking two files in the same folder: ./hello.jpg
linking two files, one in a folder, one in its top level: ../hello.jpg
linking two files, totally different folders: ../../../images/jpegs/hello.jpg

you get it?
 

NucleusKore

TheSaint
Easy

Let us say you have a cd. the starting folder/point in the cd itself is called the root. So if you were to write files directly to a cd without making any subfolders you would be writing to it's root. Hope this is clear.

Now the index.htm file is usually held in the cd root. We put in any other files we want to link into folders and subfolders and link them to the index.htm file (and that's your question!).

This can be achieved by using relative links (and not absolute as in E:\blahblah\blahblah)
Now in the cd root, if you make a folder say documents, and store a file say readme.doc
to link to this file from the root index.htm you will have to use the relative link
documents/readme.doc

Now to extend the above example, in the cd root, if you make a folder say videos, and in it a subfolder, say music, and in that subfolder place a file aicha.avi
to link to this file from the root index.htm you will have to use the relative link
videos/music/aicha.avi

To do all this in a simple way if you do not know html:
  1. Make a folder on your hard disk, say, cdroot
  2. Open an html editor
  3. create the index.htm file and save it to cdroot, minimise this editor window
  4. create the directory (folder) structure you want in cd root along with the files
  5. maximise your editor and link the file. It should automatically take relative links, else you will have to look at the html source and edit the link manually. Look for what lies between
    <a href="">

Pointers:
Always use lower case: videos instead of Videos or VIDEOS
Avoid breaks in file names, use underscore for breaks: hardware_tips, instead of hardware tips
Save as index.htm and not index.html, older drives will have problem accessing your files
 
Last edited:
OP
hansraj

hansraj

In the zone
Thanks a lot NucleusKore and dheeraj as well. I can continue with the work now which i was getting stuck. I have understood as explained by nucleusKore. Thanks for prompt help.

@ dheeraj

Use ./ and ../ for relative paths.

linking two files in the same folder: ./hello.jpg
linking two files, one in a folder, one in its top level: ../hello.jpg
linking two files, totally different folders: ../../../images/jpegs/hello.jpg

you get it?


your first line "Linking two files in the same folder...." is clear to me. However i cant understand the meaning of the rest two. Can you be a bit more elaborate. I want to know more about this.
And one more thing if u can tell me. On linking a mp3 or media file the link prompts for the download. Cant we make it play automatically as windows has the media player.
 
Thanks NucleusKore, it helped me too :)
What can I do so that the index.html autoruns when the disc is popped into the tray?
 
OP
hansraj

hansraj

In the zone
to make it autorun just make a file autorun.inf with the follwing contents

[autorun]
OPEN=index.html
icon=autorun.ico

where icon=autorun.ico will display the the icon with the name autorun.ico (this name can be any name but it should be edited accordingly in the autorun.inf). Thid autorun.ico has to be in the root folder
 

NucleusKore

TheSaint
There are nice autorun software to help you, this is one I use regularly
*www.snapfiles.com/reviews/AutorunCD_Assistant/autoruncdassist.html

Now coming to the OPs question on dheeraj's post, whenever we want to indicate that we want to move one directory up, we use ../ in a relative link.

For example. I have the following scenario
cd root contains index.htm
cd root contains three folders, documents, videos, pictures
documents contains index.htm (this is the index.htm for the documents folder only)
videos contains index.htm (this is the index.htm for the videos folder only)

Now lets say you want to link the index.htm in documents to the index.htm in cd root. You would give the relative link as ../index.htm
This means we are browsing one level up, or coming out of the folder we are currently in. In this case, when we come out of the folder document, we are in the folder (root in this case), that contains our target file, so we follow ../ with the target file name.

Now lets say you want to link the index.htm in documents to the index.htm in videos folder. So you have to
go up one level (come out of the documents folder) so that requires a ../
then enter the videos folder, so that requires videos
and specify the target, index.htm
Putting that togetther ../videos/index.htm
 

QwertyManiac

Commander in Chief
your first line "Linking two files in the same folder...." is clear to me. However i cant understand the meaning of the rest two. Can you be a bit more elaborate. I want to know more about this.
Its quite simple, a single dot (.), refers to the current working folder, while two dots (..) refers to its parent folder.
 

NucleusKore

TheSaint
If you have to come out of two folders to reach cdroot = moving two levels up, you have to specify that as

../../

to reach cd root
 
OP
hansraj

hansraj

In the zone
its all clear now..... thanks a lot. But any idea how to play the mp3 file rather than downloading it when we hyperlink it??
 

NucleusKore

TheSaint
Tough one. I have seen sites where the default media player is automatically invoked when you go to a particular page. i don't think it can be done with simple html
Anyway just see this
*www.programmingtalk.com/showthread.php?t=10955
 

sakumar79

Technomancer
Perhaps by embedding it? See *googlesystem.blogspot.com/2006/07/embed-mp3-files-into-your-website.html for details...

Arun
 
Status
Not open for further replies.
Top Bottom