23477 Posts in 18941 Topics by 2878 members
|Go to End|
13 January 2012 at 8:18am
I found where is the problem. It's a SilverStripe bug.
After using move_uploaded_file (AssetAdmin.php Line:225) the is_uploaded_file function (Upload.php Line: 480) return false.
is_uploaded_file function should be used with the original path and name of the uploaded file.
Therefore, this check should be removed from the validate() function (Upload.php) and included in the doUpload($data, $form) function (AssetAdmin.php).
Are you going to solve this problem in a new version?
Can I expect a new version soon?
Thank you very much.
13 January 2012 at 9:43am Last edited: 13 January 2012 9:54am
If I add in mysite/_config.php:
File:: $ apply_restrictions_to_admin = false;
and try to upload an image through the CMS. It produces the following error:
[User Error] Folder::addUploadToFolder: Couldn't copy '/var/www/vhosts/dominiox.com/httpdocs/silverstripe-cache/bar1111.jpg' to '/var/www/vhosts/dominiox.com/httpdocs/assets/Uploads/bar1111.jpg'
Line 260 in /var/www/vhosts/dominiox.com/httpdocs/sapphire/filesystem/Folder.php
I have to say that the bar1111.jpg file has been moved successfully to silverstripe-cache folder and is in it.
The problem comes when SilverStripe try to move the file from silverstripe-cache folder to assets/Uploads folder.
I think the problem is the internal check of the move_uploaded_file function, similar to the is_uploaded_file function.
The documentation says (move_uploaded_file):
This function checks to ensure that the file designated by filename is a valid upload file (meaning that it was uploaded via PHP's HTTP POST upload mechanism). If the file is valid, it will be moved to the filename given by destination.
As the file (bar1111.jpg) has been moved from its original position (/temp), checking POST upload mechanism fails.
What version of SilverStripe is based the demo? http://demo.silverstripe.org
There, CMS Files & Images section is working properly.
Am I doing something wrong?
Please, if someone knows a solution for this.....
13 January 2012 at 10:25pm
I've seen the bug can be fixed using this patch:
but, why has not fixed in version 2.4.6 of SilverStripe?
14 January 2012 at 2:51am
Is not there someone of SilverStripe team to answer the question?
17 January 2012 at 12:22am
Does nobody answer?
17 January 2012 at 2:24am Last edited: 17 January 2012 2:24am
Maybe when you start a new topic they give us feedback.
17 January 2012 at 5:14am
I will open a new topic.
|Go to Top|