# How to Link to Ftp File?



## el calvinist

Alright, I'm trying to upload some audio files to my webspace--which I can do fine--however, I am unable to link to that specific audio file from my webpage succesfully (I get a 404 error). Can anybody help?


----------



## fredtgreco

You do not link to the ftp. You use ftp to upload the audio file to your website, which will then need an http link.

You can see how I do it by going to:

http://tulipfaith.com/audio/


----------



## el calvinist

And how do you assign an http link to that directory/file?


----------



## fredtgreco

You want to place the file in your http folder on the server.

You should have an "httpdocs" folder or "http" folder. Ask your provider. Putting something in that main folder will cause it to be at the root. So for example if you upload sermon.mp3 into that folder, and your main website was www.website.com, the link would be



Code:


http://www.website.com/sermon.mp3


If you create a subfolder, say "audio" and put it there, then the link would be:



Code:


http://www.website.com/audio/sermon.mp3


----------



## Presbyrino

Vic,

Here is the code you put in your html page to link to a file:

Creating a link

Here is a tutorial that you might find helpful for html
HTML Goodies Tutorial

[Edited on 2-24-2006 by Presbyrino]


----------



## Semper Fidelis

Fred gives good advice but I want to make sure I understand how it is your having trouble linking to them.

Are you trying to browse to them directly from a web browser window by typing the direct URL to the file itself?

OR (as I likely suspect)

Have you created a web page using a program like frontpage or Dreamweaver and you create the link to the audio file and then when browse the page and click on the link to the audio file you get the error?

I'm guessing it's the latter. When working with HTML editors, especially the ones that kind of do the work for you, they allow you to add html links by linking to files on your computer. Those files are in a certain directory structure on your computer and that directory structure MUST be replicated on your web server.

Here's what I'm talking about:

I create my audio page, call it audio.html, in c:\My Documents\My Webs\Church Website\

The audio file in question is named file.mp3 for the examples.

Case 1: If I link to an audio file that is contained in c:\My Documents\My Webs\Church Website\ but when I upload audio.html to my web server, the hyperlink will read: http://www.website.com/file.mp3.

Why is that? Because the file.mp3 and audio.html are in the same directory on your hard drive and the HTML editor knows that and creates the link accordingly. You need to upload the file.mp3 into the same directory as audio.html.

Case 2: If I link to an audio file that is contained in c:\My Documents\My Webs\Church Website\audio\ then the link that will show up on the Internet is http://www.website.com/audio/file.mp3

Again, the audio subdirectory is related to the file audio.html by being one directory below the current directory.

Case 3: Suppose I link to an audio file that is is contained in the c:\audio\ directory. BAD!!! The html editor does not know how to create the relative link.

Bottom line:

1. Think of your domain name as the "root directory" on your web server where your web page files will go (technically it's the public_html directory or www directory but for URL display it's root).

2. Everything after a slash is a subdirectory to a domain: http://www.domain.com/subfolder1/subfolder2/subfolder3

The directory structure corresponds to:
www
---subfolder1
------subfolder2
---------subfolder3

It's all about file management. HTML merely points to files. If the pointer is to the wrong place then it's not going to find the file. It's called a URL because it is a universal resource locator. If you specify the wrong location, it cannot find the resource.

[Edited on 2-24-2006 by SemperFideles]


----------



## el calvinist

Thanks brothers.


----------

