Author Topic: Any idea why the Genesis "index.htm" file is a problematic file?  (Read 500 times)

0 Members and 1 Guest are viewing this topic.

Offline JonLeung

  • Administrator
  • *****
  • Posts: 3377
So I upload updated files to the site via FTP using FileZilla.

I have had a particular problem for a couple years now, where when I upload an updated "index.htm" file for the Genesis folder, it says it does... but the index file does not appear on the remote file listing in FileZilla, and the page disappears from the site, as if it was merely deleted.  So the way I've been updating it now is renaming it to something else, like "index.png", then uploading that with no problem, and then renaming it back to "index.htm".

I'm sick of having to do this extra step for only the Genesis (no other folder has that issue) so today I decided to delete the entire Genesis folder and start fresh, since my hypothesis was that the Genesis folder might have something weird in it, maybe ghost "index.htm" file fragments or something.  However, the problem persisted.  I deleted the folder again, made a new one with a different name (like "XGenX" and "uhhh") just in case it didn't like the name of the "Genesis" folder, with the intent to rename the folder back later if the upload worked, but no matter what, when I upload index.htm, it doesn't appear.  So, okay, I guess it wasn't the folder that had something within it preventing the upload, there's a problem with the file itself.

So I tried copying the file, and resaving the file as something else, just to make it "different", and yet it still has a problem.  I checked the file properties, and it's not hidden or anything unusual.  Even if there were some odd properties, why would being called ".htm" trigger the problem and yet ".png" or anything else does not?

What is the problem with Genesis/index.htm specifically that it can't be uploaded as it is, without renaming hijinks every time?

Offline dark_lord_zagato@yahoo.co

  • Newbie
  • *
  • Posts: 44
Re: Any idea why the Genesis "index.htm" file is a problematic file?
« Reply #1 on: August 30, 2021, 04:00:39 PM »
What if you upload an empty file with that name? Like, make a new .txt file with nothing in it so it's 0 bytes and name it "index.htm"

If that won't upload then at least you can eliminate the contents of your file as a possible cause.

Offline JonLeung

  • Administrator
  • *****
  • Posts: 3377
Re: Any idea why the Genesis "index.htm" file is a problematic file?
« Reply #2 on: August 31, 2021, 07:20:14 AM »
Great suggestion!

So I deleted the on-site "index.htm" and then uploaded a 0-byte "index.htm" as per your suggestion.  It accepted it with no issue.

I then reuploaded the proper Genesis/index.htm to overwrite it and there was no problem.

I was curious about this, as even overwriting didn't work before... so I deleted it and reuploaded it again to see if it could handle it without overwriting - and it worked!

Just in case this was a lucky FTP session, I closed FileZilla to start fresh and did it again and it uploads smoothly as one would expect - the problem appears to have been fixed!

Somehow the 0-byte file was easy for the server to accept and fixed whatever problem was there.  Which is weird since I really thought it was a problem with the file, when even new folders with other names had trouble.  Curious.  I still don't get what happened there... but at least it's not a problem anymore.

Thanks so much!   ;D  I figured someone would have an idea.  I should have asked this earlier...

Offline JonLeung

  • Administrator
  • *****
  • Posts: 3377
Re: Any idea why the Genesis "index.htm" file is a problematic file?
« Reply #3 on: September 01, 2021, 09:24:33 PM »
Never mind... the problem is back.

Why?

So strange!  Guess I'm going back to the old workaround method... sigh.

Also, why does FileZilla have to shave off 12 bytes from .htm files when I upload them, but keep the filesizes the same for all other files?  Why does it have to do anything different with HTML files anyway?  Just... upload them.  That's like a delivery person going through my packages and taking away something probably insignificant.  It's like... that's not your job... just bring it where it's supposed to go.  By uploading the Genesis .htm as a .png and then renaming it to .htm, I notice it keeps all its bytes.  Maybe when I have some time I'll download an .htm file off my site and compare it to the original and see what it removes.  Maybe I should make a much smaller one so it's easier to tell.

EDIT: A quick Google search says something about different file systems like Linux vs. Windows and recognizing it as text or something.  I should go to bed now so I'll look more into it tomorrow, including trying to upload with the "binary" transfer instead of "ASCII" or "Auto".
« Last Edit: September 01, 2021, 09:27:50 PM by JonLeung »

Offline DarkWolf

  • Hero Member
  • *****
  • Posts: 627
Re: Any idea why the Genesis "index.htm" file is a problematic file?
« Reply #4 on: September 02, 2021, 08:57:38 AM »
Is your web hosting using Linux? If so check your folder and file permissions. There exists scenarios in Linux where you can delete files from a folder because you have write access to that directory, but you can't overwrite a file in that directory because you don't have write permissions on that specific file. I would expect you'd see an error message with this sort of thing, but it's possible the server or maybe your client isn't properly handling the error or suppressing it for some reason.

Text vs binary mode can also create issues, but this usually has to do with white space or character encoding, that is, I would not expect the behavior you're describing. Doesn't hurt to try though.

Offline Grizzly

  • Full Member
  • ***
  • Posts: 182
Re: Any idea why the Genesis "index.htm" file is a problematic file?
« Reply #5 on: September 18, 2021, 11:46:51 AM »
The number 12 corresponds exactly to the number of newline characters in the Genesis index.htm. On Windows a new line is historically written with two bytes, \r\n, so the upload process most likely is converting the line endings to Unix style, removing 12 bytes.

Using binary transfer should help with this because it should exempt the file from any conversion (as does the Auto setting if it sees a file extension that normally corresponds to a binary file format; like .png).

The file replacement error also might have to do with the text processing and a hickup on certain special characters in the extended ASCII range. For example, Super Nintendo index.htm uses © (169), ® (174), ³ (179) and ÷ (247) while Genesis index.htm uses © (169), á (225), ï (239) and ü (252).
Here binary transfer should also help, or alternatively using the HTML replacement codes (e.g. á) and inserting them instead.
But binary transfer sounds more promising because as you said: the uploading process or server should not inspect the file at all but use it as is.

Offline JonLeung

  • Administrator
  • *****
  • Posts: 3377
Re: Any idea why the Genesis "index.htm" file is a problematic file?
« Reply #6 on: September 19, 2021, 06:20:07 PM »
So I've tried binary transfer as well as replacing the special characters.

Interestingly, a single "©" that I hadn't previously replaced with "©" and the "ü" you pointed out to me were both with Lunar: Eternal Blue, and I believe that is the largest map set on the Genesis page, if not all of VGMaps, as Lüt did a whopping 791 maps - honoured recently as the Maps Of The Month for August 2021.  So it was quite the replacement!

However, the uploading issue remains.  How annoying.  And baffling.  Thanks for the info and suggestions though.