[thelist] file upload class problems

Nan Harbison nan at nanharbison.com
Tue Sep 1 16:10:52 CDT 2009

This is really helpful, I am not an expert on the ini file stuff. I also
need to set the time out, as Jeremy suggested because some of these files
are ridiculously large, the biggest one so far is 65 MB, which seems really
ridiculous, so the timeout has to be huge, this file is taking over an hour
for me to upload using an ftp program! If I don't set a large timeout time,
the server still chokes on the upload.
Thanks for your help.

-----Original Message-----
From: Paul Bennett [mailto:Paul.Bennett at mch.govt.nz] 
Sent: Tuesday, September 01, 2009 3:52 PM
To: thelist at lists.evolt.org; nan at nanharbison.com
Subject: RE: [thelist] file upload class problems

Hi Nan,

It's not always convenient (or desired) to change php.ini settings directly,
as these affect *all* php scripts on the server.

You can do this on a script by script (or application by application) basis
by using ini_set() http://nz.php.net/manual/en/function.ini-set.php

For example, for the scripts you're using, you could add something like this
in the class constructor instead of needing to alter php.ini

ini_set('memory_limit', '100M');
ini_set('post_max_size', '100M');
ini_set('file_uploads', 'On');
ini_set('upload_max_filesize', '100M');


www.mch.govt.nz  -  www.teara.govt.nz  -  www.nzhistory.net.nz  -

The information contained in this email message does not necessarily reflect
the views of the Ministry for Culture and Heritage and may contain
information that is confidential or subject to legal privilege. If you are
not the intended recipient and receive this email in error: please notify
the Ministry for Culture and Heritage by return email or telephone (64 4 499
4229) and delete this email; you must not use, disclose, copy or distribute
this message or the information in it.


More information about the thelist mailing list