• Thank you for your easy to use plugin.

    I am trying to upload an audio file from a form to a custom field, but for some reason it is not working.

    How can I solve this problem?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Aurovrata Venet

    (@aurovrata)

    it is not working.

    how do you know it is not working?

    Your post title “Uploaded file not showing” suggest that you are trying to view the uploaded file in your backend. How?

    Thread Starter koki1205

    (@koki1205)

    Sorry for the lack of clarity.

    We are performing the following steps
    1. create a custom field that returns the URL of the uploaded file.
    2. post my cf7 to send file to custom field
    3. output the URL of the file to single.php

    There seems to be no problem with the form submission, but the file URL is not output to the site, and when I open the post edit screen, the custom field is empty.

    Plugin Author Aurovrata Venet

    (@aurovrata)

    There seems to be no problem with the form submission, but the file URL is not output to the site, and when I open the post edit screen, the custom field is empty.

    thanks for the clarification. Let me check this on hmy server and get back to you

    Plugin Author Aurovrata Venet

    (@aurovrata)

    I checked and its working as expected on my server. Please verify,

    1. you have no errors being reported on your server.
    2. your submitted file is being uploaded to the wp-content/upload/<year>/<month>/ folder (there could be a write permission issue.)
    3. that your file field is mapped properly.

    Thread Starter koki1205

    (@koki1205)

    Thanks for the confirmation.

    The file did not seem to be uploaded to
    wp-content/upload/<year>/<month>/.
    Thumbnail images seem to upload fine, is it a permissions issue?

    If so, how can the permissions be changed?

    Plugin Author Aurovrata Venet

    (@aurovrata)

    if the thumbnail works but not the custom field, then its unlikely a file permission. More likely some other error.

    Enable your WP_DEBUG mode with the following parameters in your wp_config.php,

    
    define('WP_GURUS_DEBUG', true);
    
     define('WP_DEBUG', true);
     if ( WP_DEBUG ) {
          define( 'WP_DEBUG_LOG', true );
          define( 'WP_DEBUG_DISPLAY', false );
         @ini_set( 'display_errors', 0 );
         define('AUTOSAVE_INTERVAL', 600 );  //seconds
     }
    

    the plugin will log (in the wp-content/debug.log file) the errors if any as to why the file is not being saved.

    Thread Starter koki1205

    (@koki1205)

    thanks.

    I checked the debug log and found the following error

    PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in wp-includes/class-wp-hook.php on line 303

    I will look into it, but it doesn’t seem to have anything to do with the plugin.

    Do you know what it is…?

    Plugin Author Aurovrata Venet

    (@aurovrata)

    it is the function used to call a function that is hooked by filter/action. This can be from your functions.php file or a plugin. Either way, the function is not being hooked properly.

    Thread Starter koki1205

    (@koki1205)

    I see, thanks.

    I tried a few things and this error seemed to occur when loading the page.

    However, it does not seem to occur when submitting a file through the form.

    Plugin Author Aurovrata Venet

    (@aurovrata)

    its actually a warning and not really an error, but could be pointing to something not working. Are you using hooks in your functions.php file?

    another test you can run is to switch themes and see if it works with a default WP theme such as Twenty-nineteen

    Thread Starter koki1205

    (@koki1205)

    In function.php, we use several hooks.

    another test you can run is to switch themes and see if it works with a default WP theme such as Twenty-nineteen

    Will test this way once!

    Thread Starter koki1205

    (@koki1205)

    After some verification, the following results were obtained.

    ①. Form submission on current site with theme change: output failed.
    ②. Create a new site and submit a form with the default theme: output successful.
    ③. Form submission on site ② using the same theme as the site in question: output succeeds.
    ④. On the site in ③, add the same plugin as the site in question and submit the form: output successful
    ⑤. On the site in ①, stop all plug-ins and submit the form: output failed

    I checked the debug.log of ⑤ and found this error.
    PHP Notice: Trying to get property 'user_nicename' of non-object in wp-includes/link-template.php on line 265.
    I went back through the logs and it looks like the error has occurred many times, but less than the number of times I have submitted the form.

    Is the custom field “user_nicname” being detected for some reason?
    Is something in the existing configuration conflicting and causing the error…?

    Plugin Author Aurovrata Venet

    (@aurovrata)

    Well done for the methodical testing ??

    However, one thing you still need to rule out is the possibility that your initial setup (site #1) is corrupt at the WP core level. So I would suggest you re-isntall the core files (wp-admin/wp-include folders), just to make sure.

    Thread Starter koki1205

    (@koki1205)

    Thanks for the advice.
    I re-installed wp-includes and it works fine!

    Now it is resolved, but I would like to report one other problem.

    When I re-installed wp-includes and uploaded a media file, there was a problem with a 403 for the URL in question.
    All files in the uploaded directory (May directory) were 403’d, and after checking permissions on directories, etc., everything looked fine.
    I manually recreated the directory and it improved, and the directory automatically generated by wordpress (when uploaded from the admin page with the may directory deleted) was also fine.

    It is now resolved, but I wonder if this has something to do with the wp-includes change?

    Thank you very much for your kind assistance in resolving the issue.

    • This reply was modified 2 years, 6 months ago by koki1205.
    • This reply was modified 2 years, 6 months ago by koki1205.
Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Uploaded files are not displayed’ is closed to new replies.