title: How to get the local path of a file in wordpress
body: <p>Since in wordpress, the files/images uploaded are stored in 3 different sizes thus taking up the memory. I have a code that re sizes the image given the URL of that image. The code to resize is:</p>
  
  <pre><code>$img = wp_get_image_editor( $image_url );
  if ( ! is_wp_error( $img ) ) {
      $img-&gt;resize( 200, 200, false );
      $filename = $img-&gt;generate_filename(
          'final', 
          ABSPATH.'wp-content/uploads',
          NULL 
      );
      $img-&gt;save($filename);
  }
  </code></pre>
  
  <p>So I want to use this code to resize the image from the local path of the user so that I don't use up too much of my memory. 
  Can anyone tell me how to get the local path and url of the file uploaded by url?</p>