Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Cannot upload images

Our old forums are still available as a read-only archive.

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

Page: 1 2
Go to End
Author Topic: 7262 Views
  • Peter
    Avatar
    Community Member
    4 Posts

    Cannot upload images Link to this post

    Windows installation. Tried to upload an images from the Files and Images area and get a popup saying:

    'file.jpg' is too large (7KB). Files of this type cannot be larger than

    [OK]

    That's all. No indication of what the max file size is (is there a config file missing or something??)

    Also, possibly related, I get a message when I rename a folder in the photos directory:
    $('Form_EditForm').getPageFromServer($('Form_EditForm_ID').value); statusMessage("Deleted 0 files.");

    Cheers,

    Peter

  • jojohio
    Avatar
    Community Member
    5 Posts

    Re: Cannot upload images Link to this post

    Hi, same problem here. Just installed windows installer did tutorial1 and now want to add a pic...

    Sorry, I can't help. Maybe someone else can?
    jj

  • Matt
    Avatar
    Core Development Team
    84 Posts

    Re: Cannot upload images Link to this post

    We'll try and get these fixed in the next release. The reason that you're not getting an indication of the maximum file size is most likely a Windows installer bug, possibly related to the other ini_get errors (such as the PHP installer not being able to find the memory_limit directive on Windows).

    I haven't been able to find a work around yet, but if I turn anything up before the next release, I'll post it here.

  • jojohio
    Avatar
    Community Member
    5 Posts

    Re: Cannot upload images Link to this post

    respect to all the work you did creating this great tool! But what shall we do with the drunken sailor? i was just gettin happy with my first selfbuilt cms.
    but without any pictures?

  • Matt
    Avatar
    Core Development Team
    84 Posts

    Re: Cannot upload images Link to this post

    Hey Peter and jojohio,

    I've found a workaround until we can get this corrected in the next release. Open up your mysite/_config.php file and insert the following text on a new line somewhere:

    // Set .jpg files to a maximum uploaded filesize of 10 MB (1024x1024 = 1MB x 10 = 10MB)
    File::setMaxFileSize(1024*1024*10, 1024*1024*10, 'jpg');

    This will allow you to upload files up to 10 MB with the extension .jpg. For now, just call this multiple times, once for every kind of file you want to upload.

    In the next release, we'll fix this so that the filesize is only limited by PHP, then we can use File::setMaxFileSize() for it's actual purpose.

    Sorry for the problems!

    Also, I noticed a problem when attempting to view a file in the Files & Images section after it's been uploaded, so I've fixed that. I've posted a new thread about that bug, so if you get a SQL error when you click on a file, check out the fix here:
    http://www.silverstripe.com/bugs/flat/370?showPost=370

  • Peter
    Avatar
    Community Member
    4 Posts

    Re: Cannot upload images Link to this post

    Thanks Matt, that fixed it (also applied the fix in the other thread you mention). All seems to be running smoothly now.

  • Edgars
    Avatar
    Community Member
    2 Posts

    Re: Cannot upload images Link to this post

    The same bug is also relevant to Ubuntu, not only Windows

  • ezgranny420
    Avatar
    Community Member
    4 Posts

    Re: Cannot upload images Link to this post

    Hi Matt, thanks for the tip and I'm glad to see it helped Peter. I did not stop my installation from having these errors though. It still can't upload images to assets or rename folders. I believe my ISP is running Ubuntu. I used the PHP installer. Any other tips would be much appreciated!

    P.S. I'm also receiving the dhtml tooltip error in the lower right corner saying 'nothing to upload'. This happens in both ie7 and firefox 2.

    P.S. When I kill the script in AssetAdmin.php and print_r($_FILES) it shows an error 4 meaning "No file was uploaded". Also there is no tmp_file listed.

    7262 Views
Page: 1 2
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.