Hi when i try to uplad an attachment file it works only if its 1 mega or less. If its bigger it doesn't work

I change the upload configuration to let upload files untill 20 mega but it keeps without working

Any solution?

Thanks in advance

Comments

kong’s picture

Maybe it's because of the configuration of PHP in php.ini

Try to increase the number for upload_max_filesize option.

anner’s picture

you may also have to up your post_max_size in php.ini
and
Maximum file size per upload in Home » administer » settings » uploads

asespat’s picture

I coudn't find php.ini

In Administer //settings//upload i already resized untill 20 megas

Where i can find php.ini?

thanks in advance

Rosamunda’s picture

I´m not a programmer, so I would like anyone to confirm this, but, if you´re using a shared webhosting, you cannot change your php.ini file.
There´s another solution using an .htaccess file. (I don´t remember how to do it, maybe someone can help here, or maybe googling).

Rosamunda
Buenos Aires | Argentina
www.ligadelconsorcista.org

anner’s picture

php.ini is usually at /etc/php.ini
if you have shared hosting you'll have to either use .htaccess like referenced here:
http://drupal.org/node/33099#comment-58739

egruber’s picture

Although mine's closer to .5 megs.

My settings in php.ini (as mentioned above) is set to 8 MB, so that isn't it.

Any help is appreciated.

anner’s picture

as I mentioned, it may also be post_max_size in php.ini
also, if that's not the issue, what do your apache error logs say...they should tell you what your problem is

asespat’s picture

that's not the problem i will try to find the problem

It seems that the file is uploaded but goes to images instead to files

laryholland’s picture

There are a few issues to consider regarding file uploads and drupal.

1. post_max_filesize = XXM needs to be set above 8M, the default. Otherwise it overrides the

2. upload_max_filesize = XXM needs to be set above 2M, the default or it will cap your upload.

Your uploads will be capped to your POST_MAX_FILESIZE irregardless of what your UPLOAD_MAX_FILESIZE is set to because you are posting data through the php compiler using the upload forms with drupal.

3. file_uploads = On

The above is obvious or you will receive errors with your uploads.module.

4. upload_tmp_dir = : defaults to being commented out.

The above should probably only be changed on a dedicated application server for one customer because modifying it for a shared platform could be problematic where there are multiple users. The upload_tmp_dir defaults to apache's default directory which must have permissions set to the owner of the apache run.

Anyone looking at bypassing certain issues with their php.ini if they are using a drupal unfriendly shared host should examine the following php.net page including the comments associated with the code examples. It is very helpful and contains good code snippets.

http://us2.php.net/features.file-upload

If you have any other questions with your fileuploads or if you are on a limited host, feel free to email me at laryholland@sbcglobal.net and we can work these issues out.

Rosamunda’s picture

Is there a way to hack the Upload Module to restrict access to uploaded files?
Not just "hide" the link, but to truly restrict access, but still letting people to access files for free access... something like creating the "private" category and the "public" category...

(bump!)
(bump!!)
(bump!!!)

anner’s picture

No offense, but this doesn't make sense. Either a file is available publicly or it's private (available only to certain users with certain permissions). Which do you want?

Anonymous’s picture

Hi,
I am having problems with the .htaccess file.
I am creating it with textedit under Mac OS X.
I put the lines

php_value upload_max_filesize 35M
php_value post_max_size 35M

But I get a 500 error.

With what software should I create this file?
Also, some users are writing .......size = 15000000 instead of 15M
Which is the right way?
Thanks.

Michaël

anner’s picture

First, any text editor should be able to create your .htaccess file.
Second, your host may not allow you to change your php values.
Third, either way is correct.