PDA

View Full Version : How to get download file to work



Computerevival
04-17-2008, 05:14 PM
Hi I am using Dreamweaver to build my website and am having a particular problem getting a batch file link to download. I have the file uploaded to the correct directory and a proper link to the file. The problem is that when you click on the link it gives a 404 error. The page with the problem is at http://www.computerevival.com/TipsandTricks/Articles/updateissues.html. This link is at the bottom of the page with the text "Click Here to Download Automatic Fix"

The file is a .bat file I don't know if that is a problem but regardless on the same note how would I get a file to download as such.

If anyone can help me I'd really appreciate it.
Thank you

Early Out
04-17-2008, 05:24 PM
Based on the very clear error message, the file is simply not where the link is expecting to find it. First, remember that filenames are case-sensitive, so fixupdates.bat and Fixupdates.bat are two different files.

Beyond that, make sure the file is actually under public_html/TipsandTricks/Articles.

charlesp
04-18-2008, 12:07 AM
If you move a file and DW asks "update links" and you answer yes, DW will sometimes loose track of where the file is. When this happen to me I move the file back and when asked "update links" I'll say no. Then I move it back to where I want it and answer no again. Then the link should work.

Pay attention to your address bar when working with this problem. It will help more than anything else.

Computerevival
04-18-2008, 08:51 AM
Well I'm positive it is in the correct directory and I ran link checker to make sure that the link is not broken. I have even tried moving the file to the root folder and it would not work. Could it be something with the FTP not allowing people to download items from my site?

Early Out
04-18-2008, 08:59 AM
I thought perhaps the server wasn't allowing a .bat file to be downloaded, but I just did a quick test, and it works fine. Is there anything odd in your .htaccess file?

Computerevival
04-18-2008, 12:28 PM
# Use PHP5 as default
AddHandler application/x-httpd-php5 .php

Is there anything I need to add to it? I don't know php very well so I wouldn't know what to put. Could this be the problem?

Thanks for all the help

Early Out
04-18-2008, 01:07 PM
Nope, nothing strange there. I thought perhaps there was some sort of hotlinking protection turned on, but there isn't.

I confess that I'm stumped, since linking to a file is the simplest of things you can do on a web page!

areidmtm
04-18-2008, 01:14 PM
Have you tried zipping up the bat file and trying to download the zip file?

felgall
04-18-2008, 02:18 PM
Since most .bat files offered for download are viruses most anit-virus programs and/or firewalls will block the download of all bat files including those few such as yours which are not viruses. The best way to offer files for download so as to avoid file type issues is to offer them as a zip file (which also has the benefit of making the download file smaller and allowing multiple files to be included in the one download so that you can include instructions with the file).

Early Out
04-18-2008, 02:36 PM
That was my first thought, but the error message isn't coming from a firewall or anti-virus program. It's a standard 404 "not found" error. The file simply isn't where Computerevival thinks it is, or the name isn't what he thinks it is. My prediction is that this is going to turn out to be one of those "D'oh!" problems - something very simple, but easily loused up.

Computerevival
04-18-2008, 06:40 PM
I will go over the coding and link references again. I figured it would be straight forward to do something like this. Very weird. I will keep messing with it. In the mean time thanks again.

Early Out
04-18-2008, 06:45 PM
Stick to a very simple test. Create a one-line file and call it test.bat. Upload it to your public_html directory. Now, enter www.computerevival.com/test.bat in your browser's address bar. Does it cough up that file?

Computerevival
04-18-2008, 09:01 PM
Now this is very interesting. I ran a few simple tests with different file types and tried using various FTPs. None of the added files worked. I had to create a new document within Dreamweaver, copy the code for the batch file and then rename it to fixupdates.bat. Basically, I'm guessing that Dreamweaver did not recognize the original batch file unless it was created with Dreamweaver itself. So if when you put a file within DW and it does not have a DW symbol it will not work.

What a pain. Thank goodness I figured it out. My sixth sense troubleshooting strikes again.

Computerevival
04-22-2008, 08:41 AM
The only thing I wasn't doing is putting the files on the web that I wanted to use. I had just copied them into the site directory instead of putting dependent files of the page with the link. Early Out you were right, D'oh!

Thanks for all the help guys