• Resolved yzhak

    (@yzhak)


    Hello.

    Plugin returns error when I try to upload any file.
    Standart CF 7 file field work fine.
    Plugin upload folder is created
    The text on an error: “(0) There was an error uploading the file. “
    It’s not changed whenI try to change it from the admin panel so I cannot understand if it’s php error or smth other.
    What it can be?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter yzhak

    (@yzhak)

    Console returns this: https://prnt.sc/qnDhD5FSXFr2

    Plugin Author Glen Don Mongaya

    (@glenwpcoder)

    Hello @yzhak ,

    Thanks for reaching out, can you check and see if the folder “/wp-content/uploads/wp_dndcf7_uploads” is writable or exists?

    The error is related to the file.php under /contact-form-7/includes/file.php, in this function wpcf7_file_messages.

    So I’m not sure why it’s showing in my plugin.

    Can you provide a link to your site where the form was added?

    Thanks,
    Glen

    Thread Starter yzhak

    (@yzhak)

    Yes it’s writable
    https://prnt.sc/ZTqgLIcasr0y
    also I debuged
    $_FILES array
    $file = isset( $_FILES[$name] ) ? $_FILES[$name] : null;
    and it returns
    https://prnt.sc/rkWT9tTfimij

    Thread Starter yzhak

    (@yzhak)

    Also error message goes from you plugin settings https://prnt.sc/f8AjLYa8TD6J https://prnt.sc/tUguIYS7GuMZ

    • This reply was modified 6 months, 1 week ago by yzhak.
    Thread Starter yzhak

    (@yzhak)

    Trouble is in the move_uploaded_file function
    tmp filename is /tmp/phpHVgBhb
    new_filename is /var/www/html/wordpress/wp-content/uploads/wp_dndcf7_uploads/wpcf7-files/shuf.jpg

    • This reply was modified 6 months, 1 week ago by yzhak.
    Plugin Author Glen Don Mongaya

    (@glenwpcoder)

    Thanks for letting me know.

    Can you add this code to debug above the is_uploaded_file condition? https://prnt.sc/pt-maCDY9APw

    var_dump( is_uploaded_file( $file['tmp_name'] ) )

    if ( ! is_uploaded_file( $file[‘tmp_name’] ) ) {

    And also this code above move_upload_file condition this. https://prnt.sc/UOAgSUdfAxyf

    var_dump( move_uploaded_file( $file['tmp_name'], $new_file ) );

    if ( false === move_uploaded_file( $file[‘tmp_name’], $new_file ) ) {

    Please let me know the result.

    Thanks.

    Thread Starter yzhak

    (@yzhak)

    /var/www/html/wordpress/wp-content/uploads/wp_dndcf7_uploads/wpcf7-files is writable

    /tmp also writable and redable

    • This reply was modified 6 months, 1 week ago by yzhak.
    Plugin Author Glen Don Mongaya

    (@glenwpcoder)

    Thanks for letting me know with all the info.

    It’s weird we’re my plugin and standard cf7 file upload are almost the same process and use function move_uploaded_file function.

    Can you compare the wpcf7_uploads and wp_dndcf7_uploads folder if it’s has the same number permission?

    Thread Starter yzhak

    (@yzhak)

    /var/www/html/wordpress/wp-content/uploads/wp_dndcf7_uploads/wpcf7-files has root owner.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘File upload error’ is closed to new replies.