Problem with file download link

TimTDP

Expert Member
Joined
Feb 23, 2007
Messages
1,228
Reaction score
131
Location
Under the slopes of Table Mountain
I am using Dreamweaver 8 to develop a website. I am a newbie!
I have the code:

<td><a href="myfile.exe" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('download_r2_c2','','../buttons/download_r2_c2_f2.gif',1);" ><img name="download_r2_c2" src="../buttons/download_r2_c2.gif" width="148" height="34" border="0"></a></td>

When I test the page on my PC it works perfectly. The file download box opens asking me what I want to do, where I want to save the file etc.

However, when I test it from my actual website, I get a page of gibberish!

What am I doing wrong?

Also,

I have the following menu:
<td width="100" valign="middle" nowrap bordercolor="#333333" bgcolor="#FFFFFF"><ul class="MenuBarHorizontal style19 style20 style20" id="MenuBarData">
<li><a href="#" class="style20 MenuBarItemSubmenu"><strong>Data</strong></a>
<ul>
<li><a href="../logdata/LogData.htm" class="style20">LogTagData.com</a></li>
<li><a href="../pimm/pimm.htm" class="style20">PIMM LogTags</a></li>
<li><a href="../InstantLogger/InstantLogger.htm" class="style20">Instant Logger</a></li>
</ul>
</li>
</ul></td>

When I test the menu on my PC it works perfectly and the correct pages open.
However when testing on my website, if I select logdata and pimm both return: The requested URL /Demo/logtag/LogTag.htm was not found on this server.
Yet InstantLogger works
I have conformed that the pages are on the server!
 
Few tips:

Link with /logdata/LogData.htm instead of the ../logdata/LogData.htm

So if your website is: http://www.mysite.com

And Log Data is: http://www.mysite.com/logdata/LogData.htm

You don't need the "../" beforehand. Otherwise use the full URL instead.

What web server are you using? I assume IIS

Welcome to "testing" on your machine and what really happens on a live machine ;) That's why you need a development server :D

Anyway. Check your MIME types on the server. It may be that it's not correctly setup for .exe so it comes through as plain text and thats why you see the gibberish on your browser. MIME types basically tells the browser what type of file it's receiving. So if the server is telling your browser "text" it will handle it as text. There's a way you can force MIME types when downloading a file but that's a bit more complicated than what you want to accomplish. So that's my first guess (and usually, by default. exe/rar etc is not handled, I'm suprised you didn't get a HTTP 404 error)

As for the .htm files giving you that error. Again, check the MIME types on the server, however, by default it should serve those pages at least, but won't put it past the setup (depending on the type of server) that it's probably only setup to serve .html files.

It's also possible (depending on the server) that it's case sensitive (the files), so if you upload instantlogger.htm and link to InstantLogger.htm, you'll get HTTP 404.

Again

Welcome to the wonderful world off web development. And get ready to spend days debugging a simple problem :D
 
Before you get TOO stuck in your old ways, try reading up on CSS and web standards. You'll learn alternate ways to replace tables and could eliminate lots of those "onmouseover" / "onmouseout" statements by using some simple CSS. It will create some nice, clean HTMl markup which is easier to debug as well.
 
Before you get TOO stuck in your old ways, try reading up on CSS and web standards. You'll learn alternate ways to replace tables and could eliminate lots of those "onmouseover" / "onmouseout" statements by using some simple CSS. It will create some nice, clean HTMl markup which is easier to debug as well.

He's using Dreamweaver, so suspect he doesn't know too much about HTML either.

Staying away from WYSIWYG editors for as long as possible until you know your <tr> from your <td> is a good aggressive way of learning
 
Top
Sign up to the MyBroadband newsletter
X