if the image name more than 15, then it will auto add white space and cause the og issue.
how can we solve this beside make the image name shorter than 15 character.
Attachments
No-space in file or directory name "filemanager"
Hi, can give the link as my version is 2.0.1.2.ojars26 wrote:I use this and it works for me! No-spaces in filename or directory
Thanks
I notice if the image with the space in the image files name, it will cause the og error.
How can I do in order the image manager will auto remove all the space in the image files name ?
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
Hi Vincentvincent_angbt wrote:Hi,
I notice if the image with the space in the image files name, it will cause the og error.
How can I do in order the image manager will auto remove all the space in the image files name ?
You are correct server don't like filename with spaces. You can use an extension that will also automatically replace empty spaces with an underscore so to eliminate this problem...
This is one for example:
http://www.opencart.com/index.php?route ... n_id=19083
Over 95% of all computer problems can be traced back to the interface between the keyboard and the chair...
I updated the filemanager ocmod. now it will also add underscore when you upload image.
example:
upload = "image name u nderscore.jpg"
result = "image_name_____u_nderscore.jpg"
The mount of underscore should be filtered so to output a unique underscore when tracking filenames in case multiple instances of underscore would be used to the same location on a filename.ojars26 wrote:Hi!
I updated the filemanager ocmod. now it will also add underscore when you upload image.
example:
upload = "image name u nderscore.jpg"
result = "image_name_____u_nderscore.jpg"
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Code: Select all
upload = "image name u nderscore.jpg"
result = "image_name_____u_nderscore.jpg"
No, it's not. The mount of space shouldn't follow with the same mount of underscores. It should rather be filtered with a unique underscore on filenames.result = "image_name_____u_nderscore.jpg"
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
like this?straightlight wrote:No, it's not. The mount of space shouldn't follow with the same mount of underscores. It should rather be filtered with a unique underscore on filenames.result = "image_name_____u_nderscore.jpg"
Code: Select all
upload = "image name u nderscore.jpg"
result = "image_name_u_nderscore.jpg"
Yes, that would be the right file structure. Although, I would also limit the string size in case it gets too long - ending with a random number as an ending length in case it would exceed the length of characters on the filename.ojars26 wrote:like this?straightlight wrote:No, it's not. The mount of space shouldn't follow with the same mount of underscores. It should rather be filtered with a unique underscore on filenames.result = "image_name_____u_nderscore.jpg"
Code: Select all
upload = "image name u nderscore.jpg" result = "image_name_u_nderscore.jpg"
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Hi,ojars26 wrote:Hi!
I updated the filemanager ocmod. now it will also add underscore when you upload image.
example:
upload = "image name u nderscore.jpg"
result = "image_name_____u_nderscore.jpg"
i am using default themes, will this override any files ?
and, i am using v2.1.0.2, this will work right, according to the http://www.opencart.com/index.php?route ... n_id=19083 it's compatible.
what's the different of:
PowerImageManager.MijoShop.ocmod.zip & PowerImageManager.3.1.4.ocmod.zip

Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
if there any code we can change in order to achieve thisstraightlight wrote:Since you're using a contributed file manager, you'd need to contact the developer of that extension to get more information regarding your last enquiry.

For those inquiries, you need to contact the developer of those contributions.what's the different of:
PowerImageManager.MijoShop.ocmod.zip & PowerImageManager.3.1.4.ocmod.zip
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Opencart 2.x-2.2 filemanager upload_add_underscore and view-fix</name>
<code>8859B85845BE3476E907250B88</code>
<version>1.0.2</version>
<author>ojars26</author>
<file path="admin/controller/common/filemanager.php">
<operation>
<search>
<![CDATA['name' => implode(' ', $name),]]>
</search>
<add position="replace">
<![CDATA['name' => basename($image), //without added spaces, longnames fixed with in filemanager.tpl adding style="word-wrap: break-word;"]]>
</add>
</operation>
<operation>
<search>
<![CDATA[$filename = basename(html_entity_decode($this->request->files['file']['name'], ENT_QUOTES, 'UTF-8'));]]>
</search>
<add position="after">
<![CDATA[$filename = str_replace(' ', '_', preg_replace('/\s+/', ' ', $filename)); //Remove extra spaces & replace spaces with underscore]]>
</add>
</operation>
</file>
<file path="admin/view/template/common/filemanager.tpl">
<operation>
<search>
<![CDATA[<div class="col-sm-3 text-center">]]>
</search>
<add position="replace">
<![CDATA[<div class="col-sm-3 text-center" style="word-wrap: break-word;">]]>
</add>
</operation>
</file>
</modification>
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Users browsing this forum: No registered users and 74 guests