[OJS 3.0.2] I can't download any file by clicking on download links

Hallo Leute!

I’d like to ask you for help. I’m editor at a Brazilian Journal and ever since we launched it I can’t download any file except by clicking right button + save as.

I’ve read through this forum and even tried to change my files_dir address, with no success. Even though the files_dir address actually refers to the folder where all submissions are located, I still can’t download it by simply clicking on the submission links.

All help is appreciated here!

Greetings,

Felipe Adão

Hi @Felipe_Adao,

Is it all users who can’t download files or only users in certain roles? Does anything happen when you try to download the file? Do you get an error message? I would try checking your PHP error log right after you click the download button.

Best,
Amanda Stevens
Public Knowledge Project Team

Hi, @astevens,

Thanks for the reply! Yes, all users, from authors to the admin, report this error. Nothing happens when I try to download the file, like in the picture below:

image

I checked the PHP error log once and it had a message saying the file doesn’t exist in the server.

I’ve already changed the files_dir path and I can even access all the stored files in the “files_dir” folder, so it means they are being stored there.

In order to help you, I’ve tried to download a file right now and here’s the error log:

[revistatdh.org] [Mon Dec 03 17:51:35 2018] [error] [client m6JSGNLGuGwTzRwzQ4ECeg] File does not exist: /home/domains/revistatdh.org/ojs3/public, referer: Revista Jurídica Trabalho e Desenvolvimento Humano
[revistatdh.org] [Mon Dec 03 17:51:35 2018] [error] [client m6JSGNLGuGwTzRwzQ4ECeg] script not found or unable to stat: /home/domains/revistatdh.org/error404.html, referer: Revista Jurídica Trabalho e Desenvolvimento Humano
[revistatdh.org] [Mon Dec 03 17:51:35 2018] [error] [client m6JSGNLGuGwTzRwzQ4ECeg] File does not exist: /home/domains/revistatdh.org/ojs3/public, referer: Revista Jurídica Trabalho e Desenvolvimento Humano
[revistatdh.org] [Mon Dec 03 17:51:35 2018] [error] [client m6JSGNLGuGwTzRwzQ4ECeg] script not found or unable to stat: /home/domains/revistatdh.org/error404.html, referer: Revista Jurídica Trabalho e Desenvolvimento Humano
[revistatdh.org] [Mon Dec 03 17:58:03 2018] [error] [client /78MN0Ib1NIy/KdmB51cWA] File does not exist: /home/domains/revistatdh.org/ojs3/public, referer: Revista Jurídica Trabalho e Desenvolvimento Humano
[revistatdh.org] [Mon Dec 03 17:58:03 2018] [error] [client /78MN0Ib1NIy/KdmB51cWA] script not found or unable to stat: /home/domains/revistatdh.org/error404.html, referer: Revista Jurídica Trabalho e Desenvolvimento Humano
[revistatdh.org] [Mon Dec 03 17:58:03 2018] [error] [client /78MN0Ib1NIy/KdmB51cWA] File does not exist: /home/domains/revistatdh.org/ojs3/public, referer: Revista Jurídica Trabalho e Desenvolvimento Humano
[revistatdh.org] [Mon Dec 03 17:58:03 2018] [error] [client /78MN0Ib1NIy/KdmB51cWA] script not found or unable to stat: /home/domains/revistatdh.org/error404.html, referer: Revista Jurídica Trabalho e Desenvolvimento Humano
[revistatdh.org] [Mon Dec 03 18:14:57 2018] [error] [client /78MN0Ib1NIy/KdmB51cWA] File does not exist: /home/domains/revistatdh.org/ojs3/public, referer: Revista Jurídica Trabalho e Desenvolvimento Humano
[revistatdh.org] [Mon Dec 03 18:14:57 2018] [error] [client /78MN0Ib1NIy/KdmB51cWA] script not found or unable to stat: /home/domains/revistatdh.org/error404.html, referer: Revista Jurídica Trabalho e Desenvolvimento Humano
[revistatdh.org] [Mon Dec 03 18:14:57 2018] [error] [client /78MN0Ib1NIy/KdmB51cWA] File does not exist: /home/domains/revistatdh.org/ojs3/public, referer: Revista Jurídica Trabalho e Desenvolvimento Humano
[revistatdh.org] [Mon Dec 03 18:14:57 2018] [error] [client /78MN0Ib1NIy/KdmB51cWA] script not found or unable to stat: /home/domains/revistatdh.org/error404.html, referer: Revista Jurídica Trabalho e Desenvolvimento Humano
[www.revistatdh.org] [Mon Dec 03 19:52:27 2018] [error] [client m+NGLyKnaN6MDcvJcdFrdQ] File does not exist: /usr/share/apache2/.well-known/assetlinks.json
[www.revistatdh.org] [Mon Dec 03 19:52:27 2018] [error] [client m+NGLyKnaN6MDcvJcdFrdQ] script not found or unable to stat: /home/domains/www.revistatdh.org/error404.html

Thanks in advance for your help and hope you have some clue about what’s going on!

Best regards,

Felipe

@astevens,

Any clue about this one?

Thanks!

Felipe Adão

Hi @Felipe_Adao,

Sorry for the delay in replying. It looks like it might be a problem with the file path. Do you have any re-write rules in place for your install? Did you change the base_url settings in config.inc.php?

Best,
Amanda Stevens
Public Knowledge Project Team

So, I checked my config.inc.php file and it’s written like that:

[general]

; Set this to On once the system has been installed
; (This is generally done automatically by the installer)
installed = On

; The canonical URL to the OJS installation (excluding the trailing slash)
base_url = “http://revistatdh.org

; Session cookie name
session_cookie_name = OJSSID

; Session cookie path; if not specified, defaults to the detected base path
; session_cookie_path = /

; Number of days to save login cookie for if user selects to remember
; (set to 0 to force expiration at end of current session)
session_lifetime = 30

; Enable support for running scheduled tasks
; Set this to On if you have set up the scheduled tasks script to
; execute periodically
scheduled_tasks = On

; Site time zone
; Please refer to lib/pkp/registry/timeZones.xml for a full list of supported
; time zones.
; I.e.:
;
; time_zone=“Amsterdam”
time_zone = “UTC”

; Short and long date formats
date_format_trunc = “%m-%d”
date_format_short = “%Y-%m-%d”
date_format_long = “%B %e, %Y”
datetime_format_short = “%Y-%m-%d %I:%M %p”
datetime_format_long = “%B %e, %Y - %I:%M %p”
time_format = “%I:%M %p”

; Use URL parameters instead of CGI PATH_INFO. This is useful for
; broken server setups that don’t support the PATH_INFO environment
; variable.
disable_path_info = Off

; Use fopen(…) for URL-based reads. Modern versions of dspace
; will not accept requests using fopen, as it does not provide a
; User Agent, so this option is disabled by default. If this feature
; is disabled by PHP’s configuration, this setting will be ignored.
allow_url_fopen = Off

; Base URL override settings: Entries like the following examples can
; be used to override the base URLs used by OJS. If you want to use a
; proxy to rewrite URLs to OJS, configure your proxy’s URL here.
; Syntax: base_url[journal_path] = Revista Jurídica Trabalho e Desenvolvimento Humano
; To override URLs that aren’t part of a particular journal, use a
; journal_path of “index”.
; Examples:
; base_url[index] = http://revistatdh.org; base_url[myJournal] = Revista Jurídica Trabalho e Desenvolvimento Humano
; base_url[myOtherJournal] = http://www.revistatdh.org

; Generate RESTful URLs using mod_rewrite. This requires the
; rewrite directive to be enabled in your .htaccess or httpd.conf.
; See FAQ for more details.
restful_urls = Off

; Allow the X_FORWARDED_FOR header to override the REMOTE_ADDR as the source IP
; Set this to “On” if you are behind a reverse proxy and you control the X_FORWARDED_FOR
; Warning: This defaults to “On” if unset for backwards compatibility.
trust_x_forwarded_for = Off

; Allow javascript files to be served through a content delivery network (set to off to use local files)
enable_cdn = On

; Set the maximum number of citation checking processes that may run in parallel.
; Too high a value can increase server load and lead to too many parallel outgoing
; requests to citation checking web services. Too low a value can lead to significantly
; slower citation checking performance. A reasonable value is probably between 3
; and 10. The more your connection bandwidth allows the better.
citation_checking_max_processes = 3

; Display a message on the site admin and journal manager user home pages if there is an upgrade available
show_upgrade_warning = On

; Set the following parameter to off if you want to work with the uncompiled (non-minified) JavaScript
; source for debugging or if you are working off a development branch without compiled JavaScript.
enable_minified = On

; Provide a unique site ID and OAI base URL to PKP for statistics and security
; alert purposes only.
enable_beacon = 1

I’m not sure how to check if I changed the base_url settings or not. The file settings are the following:

;;;;;;;;;;;;;;;;;
; File Settings ;
;;;;;;;;;;;;;;;;;

[files]

; Complete path to directory to store uploaded files
; (This directory should not be directly web-accessible)
; Windows users should use forward slashes
files_dir = “revistatdh.orgC:Bitnamiwampstack-7.1.18-1apache2filesjournals1articles2submission”

; Path to the directory to store public uploaded files
; (This directory should be web-accessible and the specified path
; should be relative to the base OJS directory)
; Windows users should use forward slashes
public_files_dir = public

; Permissions mask for created files and directories
umask = 0022

; The minimum percentage similarity between filenames that should be considered
; a possible revision
filename_revision_match = 70

I’ve tried to find a solution to this, but still haven’t found it.

Felipe

Your files_dir setting doesn’t look right.

This should be an absolute or relative (from your OJS install) path to the root of the files directory of OJS.

I might expect something like:
files_dir = "C:/Bitnami/wampstack-7.1.18-1/apache2/files/"
or
files_dir = ../files

1 Like

Yeah, at first I wrote the files_dir path this way, but somehow the platform began to store files in this strange files_dir path.

When I check my server files, I can access this strange-named file and I can see that all submitted articles are stored there. I’ve even tried to change it, but when I do it I can’t download anything anymore!

Felipe

If that directory is working for you, then that is fine. If you want to change it, you should be able to change both the directory name and the files_dir directive simultaneously to have everything continue to work. This assumes compatible file permissions and PHP open_basedir restrictions for your selected directory.