• Resolved tosca30

    (@tosca30)


    There seems to be something broken: none of the files I load with FTP + use the plugin can be found. The plugin itself is unable to display the file thumbnail, and it is not displayed in the media library either.
    And 404 errors on the front-end, of course.

    Same files uploaded (when possible) via the media uploader are OK.

    I’m using the plugin in a multisites environment but, unless I’m mistaken, it has always worked until recently. COuld it be a consequence of the recent WordPress upgrades?

    https://www.ads-software.com/plugins/media-from-ftp/

Viewing 12 replies - 16 through 27 (of 27 total)
  • Plugin Author Katsushi Kawamori

    (@katsushi-kawamori)

    I’m sorry.
    Where it was not.

    This plug-in, If you find the same file name in which it is registered, and then modified as follows.

    The first file
    news-24953-cop-21-kesako.pdf

    Second file
    news-24953-cop-21-kesako06153349.pdf
    Meaning
    06153349 -> the 6th 15h33m49s

    Why file name is missing, I’m investigating.

    Plugin Author Katsushi Kawamori

    (@katsushi-kawamori)

    Please comment out the 364 line.

    364 $filename = str_replace(MEDIAFROMFTP_PLUGIN_UPLOAD_PATH.'/', '', strstr(wp_make_link_relative($new_url_attach), MEDIAFROMFTP_PLUGIN_UPLOAD_PATH));

    Please try to insert the following eight rows instead.

    $path_parts = pathinfo($new_url_attach);
    $urlpath_dir = wp_make_link_relative($path_parts['dirname']);
    $plus_path = ltrim(str_replace(MEDIAFROMFTP_PLUGIN_UPLOAD_PATH, '', strstr($urlpath_dir, MEDIAFROMFTP_PLUGIN_UPLOAD_PATH)), '/');
    if ( !empty($plus_path) ) {
        $plus_path = trailingslashit($plus_path);
    }
    $filename = $plus_path.wp_basename( $new_url_attach );

    Thread Starter tosca30

    (@tosca30)

    Back to the beginning: the file name is still there, but is followed by the 8 characters; it seems to work in the backend, but I still get a 404 error on the front end.
    Try the link on ‘plaquette explicative’ on this page

    Plugin Author Katsushi Kawamori

    (@katsushi-kawamori)

    It does not seem to be a file name for the problem.

    When you delete a ”06192557”, and you can see the file.

    Since plug-ins found this file, it have added the 06,192,557 so as not to overlap.
    But from the uploaded directory in FTP, wp-content/uploads/sites/3/2015/09/ copy files to perhaps could not.
    Please try to the directory you want to upload to the “wp-content/uploads/sites/3” in the FTP.
    The plug-in will copy file the date-based folder automatically.

    Plugin Author Katsushi Kawamori

    (@katsushi-kawamori)

    I would like to look at the screen shot of the execution screen of your Media from FTP.
    E-mail address is written in my plug-ins mediafromftp.php.

    Thread Starter tosca30

    (@tosca30)

    Mail sent with 3 screencopies.
    Hope this will help to solve the issue.

    Plugin Author Katsushi Kawamori

    (@katsushi-kawamori)

    Thank you for screenshots.

    In particular, it appears to be running without problems.
    It might have failed to copy the file.
    It might be better if you change the permissions on the upload directory to 777 or 757.

    Changing File Permissions
    Modifier les Permissions sur les Fichiers

    Thread Starter tosca30

    (@tosca30)

    The permissions on the upload directory is the same as all the other upload directories used by WordPress, that is 755. I don’t understand why your plugin would need other writing permissions.

    Anyway, I made a test with the permissions modified to 777, and I still got the message:

    Nom du fichier :/home/marienoe/www/wp-content/uploads/sites/3/news-24953-cop-21-kesako.pdf
    Directory name:/home/marienoe/www/wp-content/uploads/sites/3/2015/09
    You need to make this directory writable before you can register this file. See the Codex for more information. Or, filename must be changed of illegal.

    In fact, the only uploads subdirectory that has permissions other than 755 is media-from-ftp-tmp, with 705 permissions.

    Plugin Author Katsushi Kawamori

    (@katsushi-kawamori)

    It is an error to have failed a copy of the file.
    If you delete @ the 439 line, you can see detailed error messages.
    What kind of message or you will get?

    inc/MeidFromFtp.php

    before
    439 $err_copy = @copy( $copy_file_org3, $copy_file_new3 );
    after
    439 $err_copy = copy( $copy_file_org3, $copy_file_new3 );

    Thread Starter tosca30

    (@tosca30)

    Message is the following

    [15-Sep-2015 12:42:12 UTC] PHP Warning: copy(/home/marienoe/www/wp-content/uploads/sites/3/news-24953-cop-21-kesako.pdf): failed to open stream: No such file or directory in /home/marienoe/www/wp-content/plugins/media-from-ftp/inc/MediaFromFtp.php on line 440

    It seems the plugin is looking in the wrong folder. It should be:
    /www/wp-content/uploads/sites/3/2015/09/my-file-name
    instead of
    /www/wp-content/uploads/sites/3/my-file-name

    Plugin Author Katsushi Kawamori

    (@katsushi-kawamori)

    Remove the check of the following settings, please try to run the “Media from FTP”.
    Please back to the original when you’re done.

    Settings->
    Organize my uploads into month- and year-based folders

    Thread Starter tosca30

    (@tosca30)

    Version 8.6 works with multidomain environment!
    Thanks a lot for having fixed this issue.

Viewing 12 replies - 16 through 27 (of 27 total)
  • The topic ‘Files synchronized with the plugin not found’ is closed to new replies.