A little extra explanation for "Download my posts"


(sujato) #1

One of our users just got frustrated trying to download their posts. The feature works well, but they didn’t know what a .gz file extension meant and tried to open it in Notepad. Perhaps a little explanation in the notification message about the archive format and the csv format would be helpful for non-technical users.


(Jeff Atwood) #2

I originally wanted to make it a .zip file but that turned out to be surprisingly hard on Linux, much harder than you would think.

However, a .zip file is much easier to understand and opens fine on Windows, unlike .gz…


(Eoin Ryan) #3

I think that anyone who had gone to the trouble of downloading their posts won’t mind a little more effort.

A standard readme.txt could be included with every downloaded post .gz file (i.e. a second, separate, file) with a line or two saying why the archive is in .gz format and how to open it on windows. Or the short text could be displayed near the Download .gz button.

For example;

Your posts have been collected into a single file; the .gz available for download. This is a Linux file type. If you are on Windows; search for a free tool to open the .gz file. At the time of writing, Easy-7-zip or 7-zip are suitable.


(Mittineague) #4

I use a hacky (file names are edited in) DIY PHP file on my localhost

<?php
ini_set("memory_limit", -1); // no limit
set_time_limit(0); // no limit

$readfilename = "_____.csv.gz";
$writefilename = "_____.csv";

$filecontent = "";

$filepointer = gzopen($readfilename, "rb");
while (!gzeof($filepointer)) {
	$contentline = gzgets($filepointer);
	$filecontent .= $contentline;
}
gzclose($filepointer);

$filehandle = fopen($writefilename, "wb");
fwrite($filehandle, $filecontent);
fclose($filehandle);
?>

But I guess anyone that would know how to do that understands compression formats.


(sujato) #5

Something like that, but I don’t think they need to know what “Linux” is. Our user had no problem extracting it, only knowing that it needed to be extracted. There is already a “Data export complete” notification, so I would suggest simply add to that something like:

Your data export was successful! :dvd:

The above download link will be valid for 48 hours.

The data is compressed as a gzip archive. If the archive does not extract itself when you click on it, you can use the tools recommended here: The gzip home page


(Eoin Ryan) #6

That seems like the neatest solution.


(Jeff Atwood) #7

Great suggestion, I have added that!


(Jeff Atwood) #8