Pomf icon indicating copy to clipboard operation
Pomf copied to clipboard

Display file size in API

Open ghost opened this issue 8 years ago • 10 comments

As a pomf API programmer, I need some way to manage the maximum file size for certain host. It would be great if there was a page (/maxsize.php) which would show maximum size in bytes.

ghost avatar Mar 05 '16 22:03 ghost

https://github.com/nokonoko/Pomf#configuring

The "real" max upload size is left up to the person who configured the webserver to set it, so it would be pretty difficult to create a file that gets the current webserver configuration, as depending on which OS and software you run it on, there are many many places to find a webserver configuration file and many many ways you have to read them.

Otherwise, if you want to trust whatever the Gruntfile says, you can have Grunt create a simple file called /max_size that contains the plaintext number of whatever the max upload size is.

SEAPUNK avatar Mar 05 '16 22:03 SEAPUNK

It would be nice if it would be converted to bytes for API tools. It is still better than lack of such way to check max file size.

ghost avatar Mar 05 '16 22:03 ghost

It's hard to introduce any changes to the pomf API now that there are all the clones around. Many of them don't get updated from almost a year. Sure, making it so that there's a "convention" for which there is a page where you can programmatically retrieve the byte size is still better than having nothing, but it probably won't work for 99% of all alive pomf clones.

On 05/03/16 23:15, Mikolaj Halber wrote:

As a pomf API programmer, I need some way to manage the maximum file size for certain host. It would be great if there was a page (/maxsize.php) which would show maximum size in bytes.

— Reply to this email directly or view it on GitHub https://github.com/nokonoko/Pomf/issues/46.

thehowl avatar Mar 05 '16 22:03 thehowl

So, for now I'll probably just do it with good old host_list, maybe some day all clone owners will sit on #pomfret channel.

ghost avatar Mar 05 '16 22:03 ghost

how do e.g. browsers get file size of files before downloading them, then?

avail avatar Mar 06 '16 10:03 avail

@avail The Content-Length header. It's completely optional, and can be omitted if the web server is configured to.

SEAPUNK avatar Mar 06 '16 10:03 SEAPUNK

@SEAPUNK why would @lich not just utilize that header, then? Most pomf clones I've seen send the header.

avail avatar Mar 07 '16 17:03 avail

I believe lich wanta to know the max size of files you can upload, rather than the filesize of the files you download.

On 7 March 2016 18:13:56 CET, 0x617661696c [email protected] wrote:

@SEAPUNK why would @lich not just utilize that header, then? Most pomf clones I've seen send the header.


Reply to this email directly or view it on GitHub: https://github.com/nokonoko/Pomf/issues/46#issuecomment-193352467

Sent from my Android device with K-9 Mail. Please excuse my brevity.

thehowl avatar Mar 07 '16 17:03 thehowl

Oh my bad, I haven't read the post fully (was initially reading whilst on phone)

avail avatar Mar 07 '16 19:03 avail

This will not be implemented in pantsu/pomf as far as I can say as the co-maintainer. It would be idiotic to add more code to do something that is much like robots.txt, growing the size and complexity of the code. No thank you.

The v2 API is much more important for me for the eventual 3.0 branch.

So, for now I'll probably just do it with good old host_list, maybe some day all clone owners will sit on #pomfret channel.

That will not happen until Rizon allows connections from Tor or someone creates a mailing list for Pomf development and discussion. I'm banned on Rizon for operating a Tor exit from my home.

ghost avatar Mar 15 '16 17:03 ghost