NYCPHP Meetup

NYPHP.org

[nycphp-talk] Does PHP have file size download limits? Best practice?

John Campbell jcampbell1 at gmail.com
Mon May 16 14:28:01 EDT 2011


There are no filesize limits, but you can run in to memory limits if
you load the file into memory.

To avoid this, use `fpassthru`.

In terms of best practices, don't pass a user generated filename into
fopen.  It is a security mess.

If you really need to allow arbitrary filenames, you should scrub both
slashes and leading periods.



On Mon, May 16, 2011 at 2:16 PM, David Roth <davidalanroth at gmail.com> wrote:
> I want to offer users to be able to download a file from a PHP script. I
> seem to remember there were/are file size download limits with PHP? Also
> what is the best practice for doing this with a PHP script? Thanks!
>
> David Roth
>
> _______________________________________________
> New York PHP Users Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/Show-Participation
>



More information about the talk mailing list