Download error


#1

Hello Admins
I created a site for question paper and it have only html coding no php and javascript so when I tested on local server, file was downloading but when I uploaded here it is showing error 404 not found I checked the location of the files but still it is showing the same error.Now what to do?
I used tag for link to download file directly.


#2

Can you see the file in a file manager or through FTP? What is the URL you are trying to download it through?


#3

yes, I can see the file and i uploaded it through Filezilla
See example
<a href="/1st year/1st SEM/BCE/BCE 2-15.pdf "


#4

When I am clicking on Download it downloads the file as"download.htm"


#5

sorry tag is
<a href="/1st year/1st SEM/BCE/BCE 2-15.pdf" Download=“BCE Summer-15”


#6

can you give us your website address ?

the possible problem is:

Naming a folder is usually done without space in the name
All unsafe characters must always be encoded within a URL

so no free space in url
if you really want to - then put %20

1st%20year/1st%20SEM/etc.

that much for now


#7

My website address is
solutiongeek.in


#8

ok i cheked
BCE Summer-15 works other not

you mixed windows slash \
you must use / in internet :wink: ok?


#9

Ok i try using /


#10

I tried but it’s still not working
Actually BCE summer-15 is working because first i saved that file but it was not downloading so i changed location to htdocs and then i move it step by step to the destination folder and changing destination in html then it started downloading file but after all that location is same as previous location


#11

ANd yes I uploaded almost 150mb of file but it’s still showing 0mb disk space usage on C-panel


#12

unrelated to the hosting …
Your code have serious errors
do not try to use /
you must use / !

Also read this well
pay attention when you call something in the current directory where the html is located/executed

and to something beyond it (notice …/ or ./ or active directory)

https://www.w3schools.com/html/html_filepaths.asp

clean your code and validate it here https://validator.w3.org/#validate_by_input


#13

just try copy source of this http://solutiongeek.in/BE/1st%20year.html
and paste here https://validator.w3.org/#validate_by_input


#14

Thank you, @OxyDac , you perfectly identified and addressed the issue.

That said, I checked your account and I think I know why your download links don’t work.

Your download links point to file names like BEE s-14.PDF, but the file names are all like BEE s-14.pdf. Files in Windows are not case sensitive, but on MacOS and Linux (which runs on ~99.999% of all web hosting servers, including ours) are case sensitive. So document.pdf and document.PDF could actually be different files.

To prevent issues like that, I would highly recommend to consistently use lowercase file names only.


#15

thank you so much, guys
It was really helpful


#16

thanks H. but I know you actually gave an answer :slight_smile:

there is two calls for same css file http://solutiongeek.in/BE/1st%20year.html

<link rel = "stylesheet" type = "text / css" href = "\\ SOLUTION.css">
<link href = "../ SOLUTION.css" rel = "stylesheet" type = "text / css" media = "screen">

you can not just copy the index.html and multiply it
you have to think about the scope, the hierarchy of files
and edit each link (a href)

there are unnecessary /be/ in links on that page (I don’t check others)
because that page is already in that folder

It might be the simplest thing to drop everything
and start with new design and structure
naming files & folders without spaces, fix all backslash to slash etc.

there is also a css table generators online
and you can try it and have a table with each line in another color
and then put all links for pdf inside


#17

ok i recheck my code
But why BCE summer 15 is working not others they have same spacing in <a tag


#18

because small letters in extension .pdf

browsers today are smarter and they go through the error
but that does not mean that your page is all right
besides google crawlers love clean website (SEO)
not a site with full of errors
you have to respect the rules of HTML


#19

ok Thanks for the information
I am newbie that’s why I don’t know much about this


#20

Thank you so much Oxydac now it is working