-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give original filename to HTTP clients on download request for certain compression formats #32
Comments
this would require a php script to be executed for each request, which obviously slows down the downloading of the files and puts some unnecessary server load. On 5 May 2015 05:44:36 CEST, Alexander Nadeau [email protected] wrote:
Sent from my Android device with K-9 Mail. Please excuse my brevity. |
Good response. It makes me wonder if there's another way to do it. I know that some sites out there have a suffix on the URL which denotes the download filename, but as you said implementing it in an easy way would be a problem. |
well, i do know there's already a way for it that is being used for .tar.gz and some, here: https://github.com/nokonoko/Pomf/blob/master/static/includes/settings.inc.php check the array at the bottom. On 5 May 2015 10:47:20 CEST, Alexander Nadeau [email protected] wrote:
Sent from my Android device with K-9 Mail. Please excuse my brevity. |
That seems to work at upload time, no? Anyways, I think a partial solution would be script that's separate from the normal download method specifically for people who need to post links that generate the original filename. Something like a url of /alias/cllzda.bz2/gamearchive.packme.bz2 Dunno, depends how the servers are set up. |
yeah, and what would be the problem? it still saves them with the full extension rather than only .gz and such anyway, i guess the alias would actually be possible. it would just put a small load on nginx due to regex rewrites but that's definetely possible. maybe it could be on another subdomain specific for alias, so that it doesn't affect the main a.pomf.se. On 5 May 2015 11:41:16 CEST, Alexander Nadeau [email protected] wrote:
Sent from my Android device with K-9 Mail. Please excuse my brevity. |
Doing that at upload time is good for paired extension like tar.gz, but over here it would maybe just be useful for changing the kind of URL that the uploader receives when they're done.
hiding the functionality behind an FAQ, cheat sheet, or activating it based on what kind of file was uploaded like above would go a ways to making sure only people who actually need it use a function like this
Good idea. |
I'll look into it, very busy atm. A easy solution would be to detect archive formats and store their original filename and give back a download link such as a.pomf.se/RAND_STRING/arch.1.ext. That way the file will still be useable and not having to dabble around with extra subdomains. |
What about just when it ends in |
Thanks @nokonoko @NuckChorris sometimes people have files without proper extensions or non-extensions after a dot |
If it doesn't have an extension before the .gz, maintaining the file name will do nothing. If it does, that will fix it. As for not-extension-but-has-dot, can you think of any situation where a .gz file with another dot earlier in the name isn't the extension? |
Sometimes the filename itself has semantic meaning.
For example, hidden files on unix systems? People do crazy things with filenames; extensions-after-dots are just a very useful tradition of sorts |
I agree that pond should replay the file name on download, but I'm pointing out that most non-semantic issues could be solved by reading back to the previous dot. I keep saying pomf needs a server to do X-Sendfile |
Looks like we're in agreement |
Some compression formats (bz2, etc) compress a single file where the contained file is named after the archive itself. For example, "gamearchive.packme.bz2" decompresses to a file called whatever is to the left of the bz2 extension. This isn't a problem for nested archives (such as tar.gz) but it can make some single-file uploads useless due to losing the filename unless they encapsulate the archive in another useless file or vice versa.
The text was updated successfully, but these errors were encountered: