21289 Posts in 5733 Topics by 2602 members
| Go to End | ||
| Author | Topic: | 2928 Views |
-
Re: File is not a valid upload

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.
Regards,
Jose A. -
Re: File is not a valid upload

13 January 2012 at 9:43am Last edited: 13 January 2012 9:54am
More problems.
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'
POST /admin/assets/UploadFormLine 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.
Why?Am I doing something wrong?
Please, if someone knows a solution for this.....
Thanks,
Regards,
Jose A. -
Re: File is not a valid upload

13 January 2012 at 10:25pm
I've seen the bug can be fixed using this patch:
http://open.silverstripe.org/attachment/ticket/5547/2.4.1-FileUpload-2.diffbut, why has not fixed in version 2.4.6 of SilverStripe?
Regards,
Jose A.
-
Re: File is not a valid upload

14 January 2012 at 2:51am
Is not there someone of SilverStripe team to answer the question?
Thanks,
Jose A.
-
Re: File is not a valid upload

17 January 2012 at 12:22am
How strange!
Does nobody answer?
Regards,
Jose A. -
Re: File is not a valid upload

17 January 2012 at 2:24am Last edited: 17 January 2012 2:24am
Hello Jose,
Maybe when you start a new topic they give us feedback.
Marnix
-
Re: File is not a valid upload

17 January 2012 at 5:14am
I will open a new topic.
Thanks Marnix,
Regards,
| 2928 Views | ||
| Go to Top |


