nokonoko / Pomf

Simple file uploading and sharing, source for the now shut down site Pomf.se
MIT License
465 stars 98 forks source link

Display file size in API #46

Open ghost opened 8 years ago

ghost commented 8 years ago

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.

SEAPUNK commented 8 years ago

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.

ghost commented 8 years ago

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.

thehowl commented 8 years ago

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.

ghost commented 8 years ago

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.

avail commented 8 years ago

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

SEAPUNK commented 8 years ago

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

avail commented 8 years ago

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

thehowl commented 8 years ago

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 notifications@github.com 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.

avail commented 8 years ago

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

ghost commented 8 years ago

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.