Jump to:

7935 Posts in 1536 Topics by 943 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » File Size Error when i try to upload 2mb txt file

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 3012 Views
  • te_chris
    Avatar
    Community Member
    24 Posts

    File Size Error when i try to upload 2mb txt file Link to this post

    Hey,

    I'm getting this error when i try to use DOM with Uploadify to upload a 2.36mb txt file. I tried using UploadifyField::setVar to change the file size limit but that didn't seem to work either. Any ideas?

    also on an easier note, I'm displaying these files to the frontend, what's the attribute to get the image that is specific to the filetype? (i.e pdf icon for pdf, word icon for word, excel for excel etc).

    Thanks!

  • te_chris
    Avatar
    Community Member
    24 Posts

    Re: File Size Error when i try to upload 2mb txt file Link to this post

    Is anyone able to help me with this? I really need to find a solution to this problem

  • figjam
    Avatar
    Community Member
    10 Posts

    Re: File Size Error when i try to upload 2mb txt file Link to this post

    This may be because your PHP "upload_max_file_size" defaults to 2M.

    Try increasing it e.g. by putting a "php.ini" file in your sapphire directory:

    upload_max_filesize = 8M

    Worked for me!

    * If you need something larger e.g. 16M, also add: post_max_size = 16M
    * You may require a page refresh after adding sapphire/php.ini

    ADDITIONAL:
    * If using SS3 you need to put php.ini in your "framework" directory
    * If you want to put your php.ini in your home directory, you may need to fiddle with your .htaccess - see Fixing memory size post

  • Terminator4
    Avatar
    Community Member
    81 Posts

    Re: File Size Error when i try to upload 2mb txt file Link to this post

    I tried that and unfortunately I had no luck with it.

    Any other thoughts?

  • neilcreagh
    Avatar
    Community Member
    90 Posts

    Re: File Size Error when i try to upload 2mb txt file Link to this post

    I just had the same problem so I added this to my .htaccess file in the root of the site and it fixed it:

    php_value post_max_size 20M
    php_value upload_max_filesize 20M

    3012 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.