Title: PATCH &#8211; move instead copy
Last modified: August 11, 2022

---

# PATCH – move instead copy

 *  [Hrohh](https://wordpress.org/support/users/hrohh/)
 * (@hrohh)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/patch-move-instead-copy/)
 * Hi, I change code to move files
 * class.add-from-server.php
    #lines 212
 *     ```
       if ( isset( $_POST['move'] ) ) {
           if ( false === @rename( $file, $new_file ) )
               return new WP_Error( 'upload_error', sprintf( __( 'The selected file could not be copied to %s.', 'add-from-server' ), $uploads['path'] ) );
   
       } else {
           if ( false === @copy( $file, $new_file ) )
               return new WP_Error( 'upload_error', sprintf( __( 'The selected file could not be copied to %s.', 'add-from-server' ), $uploads['path'] ) );
       }
       ```
   
 * #lines 498
 *     ```
       <p><?php
       printf(
           __( '<strong>Move Files:</strong> %s', 'add-from-server' ),
           '<label><input type="checkbox" checked id="move" name="move" value="1"></label>'
       );
       ?></p>
       ```
   
    -  This topic was modified 3 years, 9 months ago by [Hrohh](https://wordpress.org/support/users/hrohh/).

Viewing 1 replies (of 1 total)

 *  [Stephane](https://wordpress.org/support/users/passimal/)
 * (@passimal)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/patch-move-instead-copy/#post-16010343)
 * Thanks very good 😉

Viewing 1 replies (of 1 total)

The topic ‘PATCH – move instead copy’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/add-from-server.svg)
 * [Add From Server](https://wordpress.org/plugins/add-from-server/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/add-from-server/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/add-from-server/)
 * [Active Topics](https://wordpress.org/support/plugin/add-from-server/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/add-from-server/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/add-from-server/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Stephane](https://wordpress.org/support/users/passimal/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/patch-move-instead-copy/#post-16010343)
 * Status: not resolved