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
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
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
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.
(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.