opening .gz text files

User Help for Mozilla Firefox
Post Reply
slickrcbd
Posts: 553
Joined: September 1st, 2010, 1:57 am

opening .gz text files

Post by slickrcbd »

I just found out that the RAAC FTP archive is gone, but there is an HTTP based mirror.
The RAAC contains GZIPped text files of stories posted to the Rec.Arts.Anime.Creative newsgroup.
When I accessed it in Firefox via FTP, Firefox would helpfully open up the story in the browser like any other text file and I could read it without further fanfare.
However, when I access the same file via one of the HTTP mirrors (not sure if more than one is still operating) I would get prompted to download the file and have to decompress it with WinRAR (or whatever) then locate and open up the file in some other program, with the inconvenience of the extension not usually being set correctly for Windows to recognize it as a plain text file, and if I used Notepad instead of Notepad++ or Word I'd often have line break problems.

Is there any way to access these .gz files and get them to open up in the browser via HTTP (or HTTPS) like they do in the same browser when accessed via FTP as the latter no longer appears to be an option?

P.S. If anybody knows the new FTP link to the RAAC archive, please feel free to respond with that instead. FTP is much easier to get things in bulk even with the Downthemall extension. If gweep is just temporarily down, that's fine too.
I've seen this problem with other sites, but RAAC is the only one I've accessed more than once or twice in the last decade, and that has been infrequent in the last 5 years.
User avatar
therube
Posts: 21698
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: opening .gz text files

Post by therube »

Opens directly here, SeaMonkey 2.49.1 & FF 52 ESR.

https://archives.eyrie.org/anime/A-ko/a ... thingie.gz

Maybe check your 'Helper Applications', might have something odd set for .gz?
Or maybe you're hitting particular files that have a wrong mime-type, so generate the prompt?
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
User avatar
Reflective
Posts: 2283
Joined: February 15th, 2007, 11:13 am

Re: opening .gz text files

Post by Reflective »

Some of them open in FF ESR 52 and some don't.

I got prompted to d/l any of the files in these two archives:
But any of the following opened normally in FF:
Don't ask me why.
slickrcbd
Posts: 553
Joined: September 1st, 2010, 1:57 am

Re: opening .gz text files

Post by slickrcbd »

therube wrote:Opens directly here, SeaMonkey 2.49.1 & FF 52 ESR.

https://archives.eyrie.org/anime/A-ko/a ... thingie.gz

Maybe check your 'Helper Applications', might have something odd set for .gz?
Or maybe you're hitting particular files that have a wrong mime-type, so generate the prompt?
This is weird. YOUR story opens the way I want, but this one, that I tried to open prompts me to download:
https://archives.eyrie.org/anime/Ranma/ ... o.sides.gz
although THIS one from the same folder opens as I want
https://archives.eyrie.org/anime/Ranma/ ... -a-kind.gz

Although it turned out that it was NOT the story I thought it was ("2 in 1" or "two shall be as one" or something to that effect by Proteus) and it is either not in the RAAC archive or removed.

There is nothing I can identify in the Applications tab of the options screen remotely related to GZIPs. There is a handler for ZIP and .RAR, but no other archives.
atlanto
Posts: 97
Joined: March 7th, 2015, 4:19 pm
Location: Japan

Re: opening .gz text files

Post by atlanto »

Unfortunately, archives.eyrie.org doesn't send 'Content-Type' in http response header. So Firefox determines the content-type based on contents. Sometimes it is determined as plain text, sometimes it is determined as binary(application/gzip) to be downloaded.

The method/logic is described here.
https://developer.mozilla.org/en-US/doc ... MIME_Types
https://dxr.mozilla.org/mozilla-central ... ecoder.cpp

If 'Content-Type' can be added to http response header, this problem could be solved, but I couldn't.

The second option is...
1. Right-click on the target file and select 'Copy Link Location'.
2. Paste it on the address bar.
3. Insert "view-source:" at the beginning of the URL and hit enter.
Oh, no, it is very inconvenient...

The third option is...
1. Create new bookmark(bookmarklet).
2. Set location as
javascript:{if(document.activeElement.href){let xhr=new XMLHttpRequest();xhr.open("GET",document.activeElement.href);xhr.send();xhr.addEventListener("load",(ev)=>{document.open();document.write(ev.target.responseText.replace(/\n/g,"<br>"));document.close();});}}
3. Select (move focus to) the target file. (at https://archives.eyrie.org/anime/ ...)
4. Click the bookmark(bookmarklet).
Oh, no, it is still inconvenient...
slickrcbd
Posts: 553
Joined: September 1st, 2010, 1:57 am

Re: opening .gz text files

Post by slickrcbd »

My guess is that is in part because it is a mirror of a now-defunct FTP site, and the files were technically binary files because they were GZIPped, but the contents of the GZIPs were text files. It was common practice back in the '90s to GZIP archived text files on FTP sites to save space, and this archive's history dates back to the mid-90's.
The archive appears to still be maintained, with new stuff still being added, I just can't find an old-style [anonymous] FTP access link anymore.
In any case, I assume they just copied the files and told Apache to serve up a directory listing FTP style, a function that has been built-in to the software since the beginning. They didn't put any more effort into it, and did not think any more was needed. No websites were created, hence the misconfiguration.
Heck, Windows 98SE can do something similar with "Personal Web Sharing" with very little skill on the user's end, and I think that was also in Windows 95, but it has been many years since I used Win95 and do not remember. I used to use that all the time to share files too big to e-mail (in those days) with a friend.
Just start up PWS, open port 80 on the firewall, have a directory set up with the files I wanted him to download, give him my IP address, and let him download them overnight while we slept (until late 2002 I was using dial-up.).
Post Reply