OJS 3.1.1.4 Upload Image Problem

Dear all,

I looked at the site but could not find the solution. I had a mistake and I changed the public directory’s location. Now when I want to add an image I see these codes:

aaaaaa

How can I solve this problem?

May you help me?

Thanks for now.

Your setting in config.inc.php for public_files_dir must match the filesystem path of the web-accessible location where your store your public files.

What was the public directory’s location before, and what is the public directory’s location now?

Before my public directory’s location was bmij.org/ojs3 (public_html/ojs3), now it’s location is bmij.org (public_html). Before I innstalled ojs3 into bmij.org/ojs3 and then I carried it to base directory.

The URL http://bmij.org/public/site/images/admin/hakem-1.png seems to resolve just fine. What is an example of a page with the broken image?

I corrected manually bu source code. But when I add a New image the problem is going on. When I add a new image the code seems that I uploaded before.

What is the value of public_files_dir in config.inc.php currently?

Screenshot_20190220-152130

This is config file’s image.

Hi @ikram,

Be careful not to put your files_dir inside your web root (public_html in your case) without somehow protecting it from direct access! This can put you at risk of attack via malicious uploads. See the note right above the files_dir directive, and the “Recommended Configuration” area of docs/README.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Yes, you are right. I will carry files directory as soon as possible.

I’m unclear how uploading a new public image might get the path wrong from these settings. What are your base_url settings?

I presume you are uploading these images via the TinyMCE text editor. What is the URL from which you are uploading the image, and what is the resulting src tag value in the uploaded image?

Note that any existing image links in existing TinyMCE text boxes that are already saved will need to be manually edited to change to the new path.

I’m sorry for the late reply. Our base_url is like this in config file:

aaa

For example I want to add an image in a new block. The screen is like this:

Ekran%20Al%C4%B1nt%C4%B1s%C4%B1

And I can show the src tag value in TincyMCE Editor:

bbb

I’m sorry to tell you with pictures but I want to show you with pictures.

This is an example of uploading a new image in a new block.

Try removing the trailing slash from your base_url in config.inc.php. I think that is where the extra slash is coming from in your img tag.

You’re right. Problem solved. Really thank you so much. You’re a real expert at this system OJS. Thank you again.