Aqui fica a solução… o ponto 1 já eu tinha resolvido, faltava-me o 2.

 

I just ran into this same problem. For me it was the Apache module mod_security that was preventing the uploads. Drupal has some issues uploading files and images when running Apache’s mod_security using the default configuration settings. Here’s what I did to identify the problem and get it working.

Besides that javascript error, there should be an error in the apache error log that you can check.

Error 1

Here’s the first error I was getting in the apache error log.
ModSecurity: Request body (Content-Length) is larger than the configured limit (131072)

The configured limit is 131072 BYTES! That’s only 128 kB!!

Solution 1

Edit /etc/apache2/conf.d/modsecurity.conf and set SecRequestBodyLimit to a larger size than the default of 128 KB and then reboot apache. I set mine to match my max_upload setting from my php.ini. Remember it has to be in bytes!

More Info about SecRequestBodyLimit
Description: Configures the maximum request body size ModSecurity will accept for buffering.
Syntax: SecRequestBodyLimit NUMBER_IN_BYTES
Example Usage: SecRequestBodyLimit 134217728
Processing Phase: N/A
Scope: Any
Dependencies/Notes: 131072 KB (134217728 bytes) is the default setting. Anything over this limit will be rejected with status code 413 Request Entity Too Large. There is a hard limit of 1 GB.

Error 2

After I fixed that error I was able to upload files without a problem and things were running smooth…until I tried uploading a certain video. All my other videos uploaded fine except this one. I checked the Apache error log and saw:

ModSecurity: Warning. Match of "eq 0" against "MULTIPART_UNMATCHED_BOUNDARY" required. [file "/etc/apache2/conf.d/modsecurity.conf"] [line "60"] [msg "Multipart parser detected a possible unmatched boundary."]

Solution 2

After digging around on teh internets I found the rule referenced in the error above will sometimes return false positives, which will then deny the request. To fix that just remove the “deny” from the rule so that it will simply log when these events occur.

Edit /etc/apache2/conf.d/modsecurity.conf and update the rule for MULTIPART_UNMATCHED_BOUNDARY, setting it to log only.

OLD

# Did we see anything that might be a boundary?
SecRule MULTIPART_UNMATCHED_BOUNDARY "!@eq 0" \
"phase:2,t:none,log,deny,msg:'Multipart parser detected a possible unmatched boundary.'"

NEW (removed ‘deny’ from line 3)

# Did we see anything that might be a boundary?
SecRule MULTIPART_UNMATCHED_BOUNDARY "!@eq 0" \
"phase:2,t:none,log,msg:'Multipart parser detected a possible unmatched boundary.'"