(Ojs 3.0.1) Upload Image Problem

In the cases where upload fails, what errors do you see in the PHP error log?

In the cases where the upload is successful, use the browser’s “Inspector” tool (right click and “Inspect Element” on the broken image) to get an idea of why the URL is broken.

(Just a note that 777 permissions are never safe to use – though they can be useful for testing.)

<img src="/ojs/public/site/images/varshilmehta/New_Bitmap_Image_(4)1.png" alt="">

This is what I am getting when i click on inspect

The image is available as http://jmri.org.in/public/site/images/varshilmehta/New_Bitmap_Image_(4)1.png, but the link specifies http://jmri.org.in/ojs/public/site/images/varshilmehta/New_Bitmap_Image_(4)1.png

The addition of the “/ojs/” at the start of the URL is causing the problem. It appears you have installed OJS in the document root for your sever. Do you have any rewrite rules in effect, or can you think of where that “/ojs/” might be coming from?

Nope, no rewrite stuff. And I have no idea, where is that ojs coming from.

I’m experiencing the same problem that ctgraham points out.

In my case, that “/ojs/” comes from here: first I installed OJS as a sort of sub-directory of my URL (my journal’s URL is the name of the site). Then, in order to “publish” the journal (that is, to make it directly visible when typing the name of the site) I moved the hole OJS directory into the /public_html/ directory.

For a reason I can’t explain, all the images are uploaded to the original paht, which includes that “/ojs/” which is no longer needed: “…/ojs/public/site/images/admin/”.

I don’t know what to modify in order to re-direct the image source function. Any idea or suggestion?

It sounds like the links to your uploaded images have been formatted as absolute URLs rather than relative URLs. Navigate to the text area where these images were uploaded (where they should be showing, but aren’t) and check the HTML source.

For example, if the image was uploaded to the Website Setting’s “Additional Content” area, navigate there and click the “<>” button.

You can view and correct the image path there.

It worked. Thanks! However, it seems like I’ll have to do the same each time I upload that kind of images, since that “/ojs/” still appearing by default.

Did you also change the base_url setting(s) in config.inc.php?

1 Like

Hi @asmecher and @ctgraham
Regarding problem when uploading image, sometimes the image is uploaded succesfully and mostly not. For example, when I used computer A it keeps showing Upload in progress… But, using another computer with the same wifi network, it was uploaded. Recently, using other computers do not work. Here the errors shown in cpanel. I do not know which one refers to image upload problem. Today I tried uploading image for footer, it failed.

[Sun Jul 30 07:17:15.020190 2017] [autoindex:error] [pid 31055] [client 52.91.164.123:56452] AH01276: Cannot serve directory /home/k2542002/public_html/: No matching DirectoryIndex (index.html.var,index.htm,index.html,index.shtml,index.xhtml,index.wml,index.perl,index.pl,index.plx,index.ppl,index.cgi,index.jsp,index.js,index.jp,index.php4,index.php3,index.php,index.phtml,default.htm,default.html,home.htm,index.php5,Default.html,Default.htm,home.html) found, and server-generated directory index forbidden by Options directive

[Sun Jul 30 06:44:33.441535 2017] [:error] [pid 21871] [client 66.249.71.153:60596] File does not exist: /home/k2542002/public_html/index.php

[Sun Jul 30 06:40:51.161114 2017] [:error] [pid 21164] [client 66.249.71.10:44027] File does not exist: /home/k2542002/public_html/index.php

[Sun Jul 30 06:40:16.762416 2017] [:error] [pid 21167] [client 66.249.79.66:46214] File does not exist: /home/k2542002/public_html/index.php

[Sun Jul 30 04:12:16.513507 2017] [:error] [pid 13968] [client 66.249.71.9:36201] File does not exist: /home/k2542002/public_html/index.php

[Sat Jul 29 22:46:17.455950 2017] [:error] [pid 22980] [client 178.149.169.204:49762] File does not exist: /home/k2542002/public_html/jurnalbeta.ac.id/wp-login.php

[Sat Jul 29 09:33:20.201459 2017] [:error] [pid 9561] [client 66.249.79.9:33279] File does not exist: /home/k2542002/public_html/index.php

[Sat Jul 29 09:21:56.370198 2017] [:error] [pid 4679] [client 66.249.79.9:62159] File does not exist: /home/k2542002/public_html/index.php

[Sat Jul 29 06:36:55.306613 2017] [:error] [pid 3829] [client 66.249.79.11:34955] File does not exist: /home/k2542002/public_html/index.php

[Sat Jul 29 06:31:11.316976 2017] [autoindex:error] [pid 713] [client 81.209.177.189:44007] AH01276: Cannot serve directory /home/k2542002/public_html/: No matching DirectoryIndex (index.html.var,index.htm,index.html,index.shtml,index.xhtml,index.wml,index.perl,index.pl,index.plx,index.ppl,index.cgi,index.jsp,index.js,index.jp,index.php4,index.php3,index.php,index.phtml,default.htm,default.html,home.htm,index.php5,Default.html,Default.htm,home.html) found, and server-generated directory index forbidden by Options directive

[Fri Jul 28 17:59:21.287242 2017] [:error] [pid 412] [client 66.249.79.69:37947] File does not exist: /home/k2542002/public_html/index.php

[Fri Jul 28 16:35:41.357926 2017] [:error] [pid 1907] [client 84.111.109.194:54725] File does not exist: /home/k2542002/public_html/jurnalbeta.ac.id/wp-login.php

[Fri Jul 28 09:55:29.353198 2017] [:error] [pid 14273] [client 66.249.71.10:49720] File does not exist: /home/k2542002/public_html/index.php

[Fri Jul 28 09:54:14.990596 2017] [:error] [pid 13876] [client 66.249.79.13:45968] File does not exist: /home/k2542002/public_html/index.php

[Fri Jul 28 09:51:32.945646 2017] [:error] [pid 12736] [client 66.249.71.9:34898] File does not exist: /home/k2542002/public_html/index.php

[Fri Jul 28 07:25:51.480994 2017] [autoindex:error] [pid 25915] [client 52.205.97.10:60598] AH01276: Cannot serve directory /home/k2542002/public_html/: No matching DirectoryIndex (index.html.var,index.htm,index.html,index.shtml,index.xhtml,index.wml,index.perl,index.pl,index.plx,index.ppl,index.cgi,index.jsp,index.js,index.jp,index.php4,index.php3,index.php,index.phtml,default.htm,default.html,home.htm,index.php5,Default.html,Default.htm,home.html) found, and server-generated directory index forbidden by Options directive

[Fri Jul 28 02:07:35.240934 2017] [:error] [pid 29768] [client 62.210.217.35:62712] File does not exist: /home/k2542002/public_html/jurnalbeta.ac.id/wp-login.php, referer: http://jurnalbeta.ac.id/wp-login.php
[Fri Jul 28 02:07:34.427692 2017] [:error] [pid 29724] [client 62.210.217.35:61583] File does not exist: /home/k2542002/public_html/jurnalbeta.ac.id/wp-login.php, referer: http://jurnalbeta.ac.id/wp-login.php

[Fri Jul 28 01:18:47.230294 2017] [autoindex:error] [pid 13573] [client 202.43.165.22:54089] AH01276: Cannot serve directory /home/k2542002/public_html/: No matching DirectoryIndex (index.html.var,index.htm,index.html,index.shtml,index.xhtml,index.wml,index.perl,index.pl,index.plx,index.ppl,index.cgi,index.jsp,index.js,index.jp,index.php4,index.php3,index.php,index.phtml,default.htm,default.html,home.htm,index.php5,Default.html,Default.htm,home.html) found, and server-generated directory index forbidden by Options directive

I think it shows same pattern errors

I don’t think any of these messages correspond to the upload failure. Do the messages from July 30 at 06:40 or at 07:17 correspond to the time you uploaded the image? What do you see when you click “View Script’s Output” in the browser’s “an error may have occurred” message?

Yes, I uploaded image at that time.
It only shows blank box as follows

image

I suppose it is possible that the click of the upload button is actually being mapped against your DocumentRoot instead of against the JBImages index.php. Do you have any re-write rules in place for your install? It doesn’t seem like OJS is installed in your DocumentRoot. Can you describe the general setup of your site?

I am sorry, I don’t have any web programming background. Can you lead me where I can find information on general setup of my site?

Can you copy and paste the URLs of your homepage and of whatever screen you are using to upload the image?

Here it is
http://jurnalbeta.ac.id/index.php/betaJTM/management/settings/website

Como solucionaste el problema…no puedo subir imagen de logo ni .css.
Me aparece un mensaje que dice:
temporal_1
Me puede ayudar.
Gracias

Hi @Pandora_ramin,

I see you’ve also posted this on another thread. Please don’t double-post; it clutters the forum.

Regards,
Alec Smecher
Public Knowledge Project Team

Sorry. I be carefull

Hello.
I’m not good at server programming and I need your help.

I have problems with ojs 3.0.2
I can not download the site’s logo
1527188541453

I can not upload images via tinyMCE
1527188434313

Configuration:
windows 2008 R2 sp1
IIS7 Web server
PHP version 5.4.1

Cache folder permissions, public files
1527188605232

The string in the config
1527188661513

I have such logs
1527188795422

If I can provide any more information, please tell me.

Thanks!