Jump to:

4891 Posts in 7260 Topics by 1472 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Unable to Upload Images on Fresh 2.3.2 Install

Getting SilverStripe up and running on your computer and on your web server.

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

Page: 1
Go to End
Author Topic: 1724 Views
  • zenmonkey
    Avatar
    Community Member
    524 Posts

    Unable to Upload Images on Fresh 2.3.2 Install Link to this post

    When I Try to upload I get the following Error:

    [Warning] copy(/var/www/vhosts/loverschoice.tv/httpdocs/assets/Uploads/54597.jpg) [function.copy]: failed to open stream: Permission denied
    POST /admin/assets/UploadForm

    Line 195 in /var/www/vhosts/loverschoice.tv/httpdocs/sapphire/filesystem/Folder.php

    Source

    186       Filesystem::makeFolder(dirname("$base/$file"));
    187       
    188       while(file_exists("$base/$file")) {
    189          $i = isset($i) ? ($i+1) : 2;
    190          $oldFile = $file;
    191          $file = ereg_replace('[0-9]*(\.[^.]+$)',$i . '\\1', $file);
    192          if($oldFile == $file && $i > 2) user_error("Couldn't fix $file with $i", E_USER_ERROR);
    193       }
    194       
    195       if(file_exists($tmpFile['tmp_name']) && copy($tmpFile['tmp_name'], "$base/$file")) {
    196          // Update with the new image
    197          return $this->constructChild(basename($file));
    198       } else {
    199          user_error("Folder::addUploadToFolder: Couldn't copy '$tmpFile[tmp_name]' to '$file'", E_USER_ERROR);
    200          return false;
    201       }
    Trace

    copy(/tmp/silverstripe-cache-var-www-vhosts-loverschoice.tv-httpdocs/54597.jpg,/var/www/vhosts/loverschoice.tv/httpdocs/assets/Uploads/54597.jpg)
    Line 195 of Folder.php
    Folder->addUploadToFolder(Array)
    Line 217 of AssetAdmin.php
    AssetAdmin->doUpload(Array,Form,HTTPRequest)
    Line 241 of Form.php
    Form->httpSubmission(HTTPRequest)
    Line 129 of RequestHandler.php
    RequestHandler->handleRequest(HTTPRequest)
    Line 143 of RequestHandler.php
    RequestHandler->handleRequest(HTTPRequest)
    Line 122 of Controller.php
    Controller->handleRequest(HTTPRequest)
    Line 277 of Director.php
    Director::handleRequest(HTTPRequest,Session)
    Line 121 of Director.php
    Director::direct(/admin/assets/UploadForm)
    Line 118 of main.php

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: Unable to Upload Images on Fresh 2.3.2 Install Link to this post

    Looks like permissions of your assets folder are incorrect. Make sure you have read / write permission to assets - chmod 755 or chmod 777 the whole directory and its children.

  • zenmonkey
    Avatar
    Community Member
    524 Posts

    Re: Unable to Upload Images on Fresh 2.3.2 Install Link to this post

    Looks like 777 did it. I had 755 before and I was still having problems

    1724 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.