2

this is my file upload code when i try to upload file which has size more than 75mb i can't upload file i did't get any error i also change php.ini file still its not working

$uploader = new Varien_File_Uploader('csvupload');
 $uploader->setAllowedExtensions(array('csv'));
 $uploader->setAllowRenameFiles(false);
 $uploader->setFilesDispersion(false);
 $path = Mage::getBaseDir('media') . DS . 'uploads';
 $fname="customer.csv";
 $uploader->save($path, $fname );
 $filename = $uploader->getUploadedFileName();

can anybody give solution?

asked Aug 18, 2015 at 6:13

2 Answers 2

4

It's not Magento but PHP/server settings that are the issue. By default PHP has a much smaller max file and post size.

Check out this article on uploading large files. Via your htaccess you can change these values. Also make sure the execution_time is high enough to process the file

php_value upload_max_filesize 80M
php_value post_max_size 80M
php_value max_input_time 300
php_value max_execution_time 300
answered Aug 18, 2015 at 6:56
5
  • i tried your answer but can't solve it...another solution? Commented Aug 18, 2015 at 7:15
  • It might be limited by your php.ini, or the hosting provider. I would advice contacting them directly to ask if increasing the size is possible Commented Aug 18, 2015 at 8:31
  • i also edit php.ini file still its not work and i am working on localhost Commented Aug 18, 2015 at 8:33
  • did you restart the server locally? (obvious question but still) Commented Aug 18, 2015 at 9:14
  • i just forgot to do this now its working...thank you... Commented Aug 18, 2015 at 10:16
2
  1. Create phpinfo.php file in root. add following code. and run it from browser.

Please check value of upload_max_file_size.

  1. Remove comment of ini_set('display_errors', 1); from index.php. Now test your code. It will show error.

  2. Enable log from admin panel and check log file.

answered Aug 18, 2015 at 6:59
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.