File not found in HTML

Problem description:
When attempting to upload a file to an HTML repl, the IDE shows the file, but attempting to access it in the code or link to the file’s URL results in a 404 error.

Expected behavior:
The page should be able to reference the file and opening a link to the file should prompt its download.

Actual behavior:
When attempting to reference the file, the page posts a 404 error, and linking to the file shows Replit’s 404 page. The expected behavior occurs with chip_gate_homebrew.zip and gba_bios.bin, but not rockman_exe_45_translated.zip or any other zipped roms I tested. I have also attempted to access the unpacked contents of the zip files, and the same issue occurs.

Steps to reproduce:
Open the page and click the blue “Play Now” button. The emulator will load the core and BIOS, but throw an error when attempting to load the rom. The game boots correctly with chip_gate_homebrew.zip

Opening https://net1.jaydenmugemuzi.repl.co/roms/rockman_exe_45_translated.zip shows a not found page. Opening the links of the other files prompts a download.

Bug appears at this link:
https://net1.jaydenmugemuzi.repl.co/

Browser/OS/Device:
Google Chrome Version 110.0.5481.181 (Official Build) (64-bit)/ChromeOS Version 110.0.5481.181 (Official Build) (64-bit)/Dell Chromebook 3100

Welcome to the community! Can you please provide the link to your Repl? The source code is a lot more helpful than the site your Repl hosts.

1 Like

https://replit.com/@JaydenMugemuzi/Net1

did you re-Run your repl after uploading the zip files? If you uploaded the zip files programmatically/through the Shell, try after renaming them through the IDE so the repl recognises the file

The repl still doesn’t recognize the file.

If it is not named with the suffix of.html , then make sure to rename it. Also, if it is not named index.html , then it does not know what to open.

Also, can you give me the link to the repl?

I’m not sure if this matters bcuz I’m a n00b, but I noticed that you had the <html> tag in addition to the <!DOCTYPE html> tag. Maybe there is only one closing tag, so one remains open.

<!DOCTYPE html> declares it is html and <html> is the start of the html code

cmon, you knew index.html but not doctype?

2 Likes

Try renaming the file, that might fix the issue.

I’ve already tried renaming the file.

What have you renamed it to? What folder is the file in?

I just removed a letter and added it back when renaming didn’t work.

on my fork it works if I rename it to just rockman.zip

Again, what did you rename it to? What letter did you remove? Is the file in the root of your project?

Hey @JaydenMugemuzi! Welcome to the community!

(skip over to Solution if you just want to fix your problem fast)

Explanation

The reason why it is not working is because your repl.co website and your Repl stores different copies of your files instead of having them at one place. To explain why this happens, you need to understand how Replit makes your websites work.

When you create a website on Replit, you actually create two of them: the website that people will see (your repl.co website) and the website that Replit uses for your Repl (something like 6e657665-7220-676f-6e6e61206769-76652079-6f75-207570.id.repl.co). When a user enters your repl.co website, it will use the files from that website, whereas when you edit your files in your Repl, it will use the id.repl.co website. Since each of them have different copies of the file, they are stored in different locations, but will always be synchronised with one another.

However, when you tried to upload your file, the file uploaded into the id.repl.co website just fine, but your own repl.co website didn’t see the changes, and so it never copied the file.

Basically, anything you do to the file (i.e. editing, renaming, etc.) will not work, since the file does not exist on your repl.co website.

I think it’s just a very rare, one-off instance of a game-breaking glitch, since when you uploaded your other files, they still work as normal.

Solution

I believe just re-uploading the file with the same name should fix the problem, which I have tried with a test ```.zip``` file and it seems to fix the problem.

but the id link also returns Not Found

Sorry, like I said, I’m kinda n00b

It’s just a sample id.repl.co website, not an actual website lol

I meant click on the link I sent, which is their id.repl.co link
https://1feadbe6-1a38-43ba-8886-7ccd05d8835e.id.repl.co/

Okay, interesting, that also doesn’t work… Now I don’t know what actually happened.

The important part is that I found a solution that worked for me, now we just have to wait for OP’s response.