Page 1 of 1

Increase upload file size for 'download files'

Posted: Sat Mar 07, 2009 2:00 am
by tv_boy123
How can I increase the size that files can be uploaded for the download section?
When trying to upload a new file that can be downloaded at:
http://www.awebsitename.com/admin/index ... g/download
it works with files less than 10MB, I want to be able to increase the file size up to around 50MB so customers can download some files that are bigger than 10MB.

However, when i try to upload files greater than 10MB i get several errors on this page:
http://www.awebsitename.com/admin/index ... oad/insert
Below are the errors that are listed:

Code: Select all

Notice: Undefined index: download_description in /home/content/e/n/o/awebsitename/html/admin/controller/catalog/download.php on line 342

Warning: Invalid argument supplied for foreach() in /home/content/e/n/o/awebsitename/html/admin/controller/catalog/download.php on line 342

Notice: Undefined index: download in /home/content/e/n/o/awebsitename/html/admin/controller/catalog/download.php on line 348

Notice: Undefined index: download in /home/content/e/n/o/awebsitename/html/admin/model/catalog/download.php on line 4

Notice: Undefined index: download in /home/content/e/n/o/awebsitename/html/admin/model/catalog/download.php on line 10

Notice: Undefined index: remaining in /home/content/e/n/o/awebsitename/html/admin/model/catalog/download.php on line 10

Notice: Undefined index: download_description in /home/content/e/n/o/awebsitename/html/admin/model/catalog/download.php on line 14

Warning: Invalid argument supplied for foreach() in /home/content/e/n/o/awebsitename/html/admin/model/catalog/download.php on line 14

Warning: Cannot modify header information - headers already sent by (output started at /home/content/e/n/o/awebsitename/html/admin/controller/catalog/download.php:342) in /home/content/e/n/o/awebsitename/html/system/engine/controller.php on line 23
Any help would be greatly appreciated, thanks.
I'm pretty sure I have to change some code in the file located in admin\controller\catalog\download.php could someone help me?

Re: Increase upload file size for 'download files'

Posted: Mon Mar 09, 2009 9:30 pm
by liquidpele
This is a php setting. See here:

http://drupal.org/node/97193
Depending on your host, changing these two PHP variables can be done in a number of places with the most likely being php.ini or .htaccess (depending on your hosting situation).

For example, to increase the limit on uploaded files to 10 MB:

* Add the below to the relevant php.ini file (recommended, if you have access). Note that for some hosts this is a system-wide setting. However, for hosts running PHP as a CGI script with suexec (for example) you may be able to put these directives in a php.ini file in your Drupal root directory.
o upload_max_filesize = 10M ;
o post_max_size = 20M ;
* Add the below to your .htaccess file in the you Drupal root directory.
o php_value upload_max_filesize 10M
o php_value post_max_size 20M

Re: Increase upload file size for 'download files'

Posted: Mon Mar 09, 2009 9:36 pm
by tv_boy123
Thank you so much liquidpele for your reply! I'll give it a go :)

Re: Increase upload file size for 'download files'

Posted: Mon Mar 09, 2009 10:54 pm
by tv_boy123
Thanks for your help. I tried what you and the people at drupal suggested, but I still got the same error hmm...i also tried what these people suggested http://www.bluehostforum.com/archive/in ... t-949.html which was to put the php.ini file into each of the folders with the download.php file in it.

Maybe I could just upload the file to my host and create a new record in the 'download' table in the database? But then I wouldn't have an encrypted version of the file...any ideas?

But yeah, the problem's with my host (godaddy) limiting the upload rather than some code in one of the files then? Or is there somewhere in one of the files that limits it?

Re: Increase upload file size for 'download files'

Posted: Tue Mar 10, 2009 1:06 am
by tv_boy123
YES!!!!!!!!!!!!!!! I got it to work!! Thank you sooooooo much :D i was clueless until you helped out! Thanks! I was looking around and cos I'm using php5 the php.ini wasn't working, so i renamed it to php5.ini and added the code you suggested. This is the code I now have in my php5.ini files:

Code: Select all

magic_quotes_gpc = off;
register_globals = off;
upload_max_filesize = 390M ;
post_max_size = 400M ;
memory_limit = 640M ;
file_uploads = On ;
magic_quotes_gpc=off;
magic_quotes_sybase=off;
I'm so happy!! I'd been puzzling over that day and night for around a week. You star ;D

Re: Increase upload file size for 'download files'

Posted: Wed Jun 24, 2009 12:27 am
by davykeenan
Hi, I put the php5.ini file in beside the php.ini file and there was no change, how long do you need to wait?

Can you tell me where you ended up putting the php5.ini file or how you got it to work?

Re: Increase upload file size for 'download files'

Posted: Thu Jun 25, 2009 5:41 am
by readyman
Hi Davy, it depends on your host if this file will work... ask your host if you are able to update those settings using the php.ini file or where they allow you to use that file. Send them that file so that they know which settings you want changed.
Although a lot of PHP installations are standard, there are still a lot of different setups.

Re: Increase upload file size for 'download files'

Posted: Thu Jun 25, 2009 6:04 am
by Daniel
i'm goign to set it so large files can be uploaded via ftp and you can just set the location in a field.

Re: Increase upload file size for 'download files'

Posted: Thu Jun 25, 2009 7:22 am
by davykeenan
Thanks ReadyMan and Daniel,

Both Answers were great, I got my hosts to change the upload limit and works fine.

Daniel, the FTP idea is great but I am just wondering how you are going to deal with the security of the files?

As Tv_boy123 says a few posts ago - "Maybe I could just upload the file to my host and create a new record in the 'download' table in the database? But then I wouldn't have an encrypted version of the file...any ideas?"

I take it you would use some sort of encryption to protect the files, similar to the current upload system or would this be up to the admin??

Re: Increase upload file size for 'download files'

Posted: Wed Jul 15, 2009 4:12 am
by jeremyc
Is there anyway I can upload the "downloadable" files via ftp and then set the cart tosee that file as downloadable?

Re: Increase upload file size for 'download files'

Posted: Wed Jul 15, 2009 5:10 am
by Daniel
I might have to push the user to rename the files something wierd.

at the moment the system renames the files with a random string and sends a different name for the files when customers download.

Re: Increase upload file size for 'download files'

Posted: Wed Aug 19, 2009 11:01 am
by cocoholo
I've contacted hostgator and they told me uploading files via php is set at 65MB.
I'm trying to upload a 12MB - didn't work out
I tried to upload a 5MB - didn't work out either.

and I got this message >> Warning: The uploaded file exceeds the upload_max_filesize directive in php.ini!

They also told me that's php.ini in the root is unusable because they've set it up globally.

>:(

anybody?

Re: Increase upload file size for 'download files'

Posted: Thu Oct 15, 2009 7:13 am
by paulsvang
I"m having the same error. My host has it at 100mb upload limit and I can't even upload 2.6mb

I can do anything under 1mb okay but the 2.6 limit is killing me. Please help. I've tried the php.ini and php5.ini m html_public folder

no luck

Re: Increase upload file size for 'download files'

Posted: Sat Nov 28, 2009 5:12 am
by Qphoria
I have a new mod that allows AutoDetect and Insert of downloads into your OpenCart system.
Simply upload the files to your download folder, and when you edit/insert a product or goto the downloads area, all the downloads will be uploaded and inserted for you.

http://www.unbannable.com/ocstore/dl_auto_insert
No more file size issues or php memory limits