Uploading through File Manager with 123-reg
Permalink 3 users found helpful
I recently created a concrete5 site on a 123-reg server.
Everything works fine, and you don't get any issues until you attempt to upload files through the file manager.
123-reg will automatically upload files with a 644 file permission, and concrete needs at least 755 to be able to read the files that you have uploaded, so all you will get is a little box with the red cross.
To fix this you need to edit two files.
/concrete/helpers/concrete/file.php
change the following code, found on line 94-107 (Concrete 5.4.2.2) from:
to:
And the other file you will need to change is:
/concrete/libraries/file/importer.php
change the following code, found on line 94 (Concrete 5.4.2.2) from:
to:
This will now create the file structure with a 777 permission, and all the files uploaded will have the correct permissions too.
Hope this helps anyone who has had the same problems!
Everything works fine, and you don't get any issues until you attempt to upload files through the file manager.
123-reg will automatically upload files with a 644 file permission, and concrete needs at least 755 to be able to read the files that you have uploaded, so all you will get is a little box with the red cross.
To fix this you need to edit two files.
/concrete/helpers/concrete/file.php
change the following code, found on line 94-107 (Concrete 5.4.2.2) from:
if ($createDirectories) { if (!is_dir($base . '/' . $d1)) { @mkdir($base . '/' . $d1, 0777, TRUE); @touch($base . '/' . $d1 . '/index.html'); } if (!is_dir($base . '/' . $d1 . '/' . $d2)) { @mkdir($base . '/' . $d1 . '/' . $d2, 0777, TRUE); @touch($base . '/' . $d1 . '/' . $d2 . '/index.html'); } if (!is_dir($base . '/' . $d1 . '/' . $d2 . '/' . $d3)) { @mkdir($base . '/' . $d1 . '/' . $d2 . '/' . $d3, 0777, TRUE); @touch($base . '/' . $d1 . '/' . $d2 . '/' . $d3 . '/index.html'); } }
to:
if ($createDirectories) { if (!is_dir($base . '/' . $d1)) { @mkdir($base . '/' . $d1, 0777, TRUE); @chmod($base . '/' . $d1, 0777); @touch($base . '/' . $d1 . '/index.html'); } if (!is_dir($base . '/' . $d1 . '/' . $d2)) { @mkdir($base . '/' . $d1 . '/' . $d2, 0777, TRUE); @chmod($base . '/' . $d1 . '/' . $d2, 0777); @touch($base . '/' . $d1 . '/' . $d2 . '/index.html'); } if (!is_dir($base . '/' . $d1 . '/' . $d2 . '/' . $d3)) { @mkdir($base . '/' . $d1 . '/' . $d2 . '/' . $d3, 0777, TRUE); @chmod($base . '/' . $d1 . '/' . $d2 . '/' . $d3, 0777); @touch($base . '/' . $d1 . '/' . $d2 . '/' . $d3 . '/index.html');
Viewing 15 lines of 17 lines. View entire code block.
And the other file you will need to change is:
/concrete/libraries/file/importer.php
change the following code, found on line 94 (Concrete 5.4.2.2) from:
return @copy($pointer, $path);
to:
This will now create the file structure with a 777 permission, and all the files uploaded will have the correct permissions too.
Hope this helps anyone who has had the same problems!
Yeah sorry I forgot to mention that!
I get this error when adding the helper file:
"Cannot redeclare class ConcreteFileHelper"
any ideas?
thanks
"Cannot redeclare class ConcreteFileHelper"
any ideas?
thanks
I've noticed that sometimes, you cannot create some of the helper files, I've noticed this with File and Pagination. So You will need to either modify the original directly, or just rename it so that it cannot be found - I normally create a new file and rename the original to _FileName.php
I will say that this has kept me sane after a year of madness. I have to add though with updating to 5.5.1 I had to hide the files in the update directory to get this to work but work it does. Thanks
Thanks everyone – this has *almost* solved a problem I am dealing with.
However my file permissions also extends to the cache folder… so for any image which creates a cached version of itself (this particularly occurs when you are using the image helper getThumbnail function) then new files in the cache folder are still created using the incorrect permissions, and thus cannot be seen on the website.
Is there anyway of making further changes to the file/importer files to solve this?
Many thanks!
However my file permissions also extends to the cache folder… so for any image which creates a cached version of itself (this particularly occurs when you are using the image helper getThumbnail function) then new files in the cache folder are still created using the incorrect permissions, and thus cannot be seen on the website.
Is there anyway of making further changes to the file/importer files to solve this?
Many thanks!
Hi
I'm new to Concrete5 and had this image issue as soon as I installed the software. I have a 123.reg hosting account (legacy Supanames).
The fix worked perfectly and files can be uploaded except the thumbnails are stil not showing. The images do appear on the created page however.
Thanks for your help.
I'm new to Concrete5 and had this image issue as soon as I installed the software. I have a 123.reg hosting account (legacy Supanames).
The fix worked perfectly and files can be uploaded except the thumbnails are stil not showing. The images do appear on the created page however.
Thanks for your help.
/libraries/file/importer.php
/helpers/concrete/file.php
You don't want to be editing things under the concrete directory, they can get overwritten when you do upgrades.