Skip to content
Sign upLog in
← Back to Community

How to use html file links in repl.it?

Profile icon
Ham48

I'm fairly new to html, as well as repl.it, so I aplogize if this is a simple or dumb question, but it hasn't made much sense to me.

In my code I use [ to link to a .zip file, when I try to use the link on the site, it returns a 404 error in the console and downloads an HTM file with no data. I attached a screenshot that should give you a basic idea of my situation. Is there any way I can make it so that the link causes the download of the file?]

[

Thanks

image

]
Answered by Coder100 [earned 5 cycles]
View Answer
Voters
Profile icon
josealencar00
Profile icon
forceofyoda
Profile icon
Ham48
Comments
hotnewtop
Profile icon
Coder100

I don't think you need the download="file"
try this:
https://www.w3schools.com/howto/howto_html_download_link.asp

I'll attach a working example

Profile icon
Ham48

@Coder100
I tried that previously, that just led me to a 404 error

image

Profile icon
Coder100

oh yeah
you need to put all the non-html files in a different folder called static


@Ham48

Profile icon
Ham48

@Coder100
oh, okay, that makes sense, thank you so much

Profile icon
Ham48

@Coder100
would I have to link to it as static/files then?

Edit: nvm that did the trick. Thanks!

Profile icon
Coder100

nope, in the root!
np!

@Ham48

Profile icon
Coder100
Profile icon
Ham48

@Coder100
I noticed the aoeu aoeu, nice dvorak gang. But looking at that, should I add /files/file.zip?

Profile icon
Coder100

ayyyy dvorak gang poggers

@Ham48

Profile icon
[deleted]

its best to just use a normal repl, but if you move out the folder out of the zip file you can upload its contents to repl.it

Profile icon
RhinoRunner

maybe try to open the page up into a new window first?
(this button)

image

Profile icon
Ham48

@RhinoRunner
Thats how I tried to download it in the first place. When I use the integrated browser nothing happens in the first place.

Profile icon
RhinoRunner

@Ham48
check the .zip file, what is in it?

Profile icon
Ham48

@RhinoRunner
The zip file has an exe in it and a text file. When I recreate this outside of repl.it it works fine, like just in a folder with local HTML files.