Cannot refer to uploaded files
Just done an install, tried to upload a file and refer it to a page 'file:/test/image_21.png'
but I got 404 file:/test/image_21.png
error message.
This my env
PHP 7.4.29 (cli) (built: Apr 12 2022 10:55:38) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with the ionCube PHP Loader + ionCube24 v11.0.1, Copyright (c) 2002-2022, by ionCube Ltd. with Zend OPcache v7.4.29, Copyright (c), by Zend Technologies
Server version: Apache/2.4.6 (CentOS) Server built: Mar 24 2022 14:57:57
Wackowiki version: 6.0.25
Server version: 8.0.19 MySQL Community Server - GPL
Any ideas?
thanks and regards
Comments
Log in or create an account to post a comment.
Re: Cannot refer to uploaded files
file:
syntax is displayed in the filemeta handler. Normally, the relative path is sufficient. The absolute path is required only when you embed a local file attached to a page in another page.A
404 file:/test/image_21.png
message indicates that either/test
page.file:image_21.png
andfile:/image_21.png
/test/attachments
-> to page -> click on the image)Please check the
file/perpage/
andfile/folder/
folder as well thefile
table in the database, if the uploaded file is there.Do you use mod_rewrite?
Re: Cannot refer to uploaded files
1. the path to the file is false --> The path is correct and has the right permission.
file/perpage/@18@image_21.png
2. the file upload failed --> Upload is succeded.
File upload successful
but alsoFile not found
messages3. the file folder has insufficient access rights --> 'file/perpage' and 'file/global' have permission (I have tried full 777 permission)
4. check the file/perpage/ and file/folder/ folder as well the file table in the database --> There are no data in the 'file' and 'file_link' tables.
5. Do you use mod_rewrite --> I have tried both 'subdomain' and 'subdirectory'
and this
and in the .htaccess (for subdir)
Thanks and regards
Re: Cannot refer to uploaded files
The WackoFormatter parses then the
file:
link and can't find the corresponding record in the file table.Did you upgrade or downgrade the wiki? Please check if the file table has no missing or changed fields, this can happen if you changed the version without using the installer. The SQL script probably fails to insert the file record due to DB structure discrepancies.
Please check the file table against the file table schema for your version.
Fix the DB structure discrepancies by hand or run a fresh install with the version you want use. Additionally you can turn on the debug option, so it will show you all failed SQL queries in the footer, look out for
-1
.https://github.com/WackoWiki/w[...]page/upload.php#L267 (Example for WackoWiki 6.1)
Re: Cannot refer to uploaded files
did you upgrade or downgrade the wiki?
> It's new fresh install 6.0.25.zip
I created the database
and then followed the install instruction. there is no error except upload file.
I tried to enable debug mode
const PHP_ERROR_REPORTING = 5
and got this message in the
/etc/httpd/logs/error_log
thanks and regards,
Re: Cannot refer to uploaded files
If you want find the error turn debugging on (including SQL queries, see system section in Admin panel) and comment out
https://github.com/WackoWiki/w[...]page/upload.php#L309
Comment out this line and read the SQL log for errors.
Admin Panel -> System -> Debug mode
Re: Cannot refer to uploaded files
This is the debug output:
I have tried 6.0.30 too, but the installation stopped before creating tables. I think I will create another thread for this problem.
Re: Cannot refer to uploaded files
[0.0003 sec., -1 rows]
as expectedPut the query as is for example in phpMyAdmin and it will tell you what is missing or wrong. And please upgrade to 6.0.30.
This is the output of my test with WackoWiki 6.0.30:
Re: Cannot refer to uploaded files
This is the error
I changed the default value
and it works..... YEAAA.....
Thanks WikiAdmin
Re: Cannot refer to uploaded files
constants.php
config.php
Can you please provide a patch.
Re: Cannot refer to uploaded files
I have tried
and config.php already set to
change back
The result is :
wacko/setup/database_mysql.php