I can not download file more 2 Mb but upload_max_filesize 32M (php.ini)
And does not get messages about it.
How to increase the limit on file upload?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

willvincent’s picture

What is the post_max_size value set to in php.ini? Both it and the upload max filesize typically need to be large enough to allow bigger file uploads, I would assume that also applies with this upload method.

willvincent’s picture

Actually, now that I look at the plupload js library docs, this is probably a setting that needs to be adjusted for it, rather than for php..

These two items jump out as relevant to me:

max_file_size
Maximum file size that the user can pick. This string can be in the following formats 100b, 10kb, 10mb.
chunk_size
Enables you to chunk the file into smaller pieces for example if your PHP backend has a max post size of 1MB you can chunk a 10MB file into 10 requests. To disable chunking, remove this config option from your setup.

ksenzee’s picture

Title: file more 2 Mb not load » hard-coded file size limits
Version: 6.x-1.x-dev » 7.x-1.x-dev
Category: support » bug
Status: Active » Needs review
FileSize
854 bytes

It looks like there's a hard-coded 10mb file size limit in plupload.module. I don't know if that was causing the problem in the original post, but it certainly isn't helping. Here's a patch that implements site-specific limits for max_file_size and chunk_size.

agentrickard’s picture

agentrickard’s picture

I think this is ready to go in, with making it configurable as a follow-up.

One question, in reading the PHP docs: do we need to account for ini.memory_limit when calculating these values? It would seem proper. http://www.php.net/manual/en/ini.core.php#ini.post-max-size

ksenzee’s picture

I can't tell from the PHP docs whether we should take memory_limit into account or not. On the one hand, it sounds like something the sysadmin should be managing. On the other hand, if the chunk size is bigger than memory_limit things will explode quite prettily.

agentrickard’s picture

Yeah, so I would think we should cap chunk size. Oddly, however, file_upload_max_size() seems to ignore that, too.

Do we know why core doesn't use memory_limit? That would answer the question.

rickvug’s picture

Also see #1060448: Support for max upload size and resize parameters which is solving the same problem but adds configuration. Personally I'd favor of getting this patch in quickly and then moving on to making the values configurable in the other issue.

agentrickard’s picture

Status: Needs review » Reviewed & tested by the community

RTBC then.

rickvug’s picture

@agentrickard Yup, I'd say so. I just tested with a 200MB file without problem.

willvincent’s picture

Re #8: I think contrary to the other request for having this be a configurable value this is the right way to do it.. These settings should ideally be managed by the sys admin in my opinion. The only instance I can think of that that wouldn't be the case would be in the instance of shared hosting, but then the settings are likely limited to too small an amount anyway, so config to try and change those settings wouldn't be useful anyway.

I think the patch as provided in #3 is probably the best solution here.

agentrickard’s picture

@willvincent

Which is why the two issues are decoupled. That debate needs to happen in the other issue.

slashrsm’s picture

Status: Reviewed & tested by the community » Fixed
rickvug’s picture

@slashrsm Excellent news! I noticed that a number of other helpful patches have gone in recently. Any chance that another beta release is around the corner? It always feels good to remove patches from make files. :)

slashrsm’s picture

Latest release (beta4) includes most of the patches I commited last weekend. As soon some other patches are commited I plan to release another release. If it's going to be another beta or rc depends on number of new issues that appear.

rickvug’s picture

I didn't realize that there was already a new release made on the 18th. Thanks!

atlea’s picture

Hi,

I agree with this patch - but just note that if php upload_max_filesize is less than 10mb people using this module will now have a reduction in max file size after this patch. 10mb would have been no problem earlier, even with upload_max_filesize set to 2mb, as it was chunked down to 1mb.

This is only really a problem using the buildt in uploader, though, as modules implementing this field element can set their own limits. E.g. in FileField Sources Plupload the limit set on the field instance - allowing one to upload files regardless of php limits.

That is another reason for not making this a configurable setting, as if could potentially confuse the user if they set 50mb in Plupload settings, but the module using the field has its own settings.

a.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

-enzo-’s picture

Status: Closed (fixed) » Needs review
FileSize
743 bytes

I just clone the branch 7.x-1.x and I don't see the change.

i did a reroll of patch contributed by ksenzee for version 7.x-1.x

slashrsm’s picture

Hm... that's strange. How did this happen... Anyway, thank you for this.

I think we need to add 'b' at the end. See patch....

slashrsm’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 6605872 on 7.x-1.x, 7.x-2.x, 8.x-1.x authored by ksenzee, committed by slashrsm:
    Issue #1230632 by ksenzee: Hard-coded file size limits.
    
    
  • Commit a74dac0 on 7.x-1.x, 8.x-1.x by slashrsm:
    Issue #1230632 by -enzo-, slashrsm: Fixed hard-coded file size limits.
    
  • Commit bac95bd on 7.x-1.x, 7.x-2.x, 8.x-1.x by slashrsm:
    Issue #1230632 by -enzo-, slashrsm: Fixed hard-coded file size limits.
    
bwaindwain’s picture

Issue summary: View changes

To anyone interested, this reverts the chunk_size setting done at previously at https://www.drupal.org/node/1461884. I don't understand why. I think 1mb is a more logical choice.