Media URL slugs without uploads folder path

if you change permalink to post name in setting and attach the testimony.pdf in your post, you will get http://example.com/your_post/testimony.pdf, to get url of the textimony u can get with this code

    <?php

$args = array(
    'post_type'   => 'attachment',
    'numberposts' => -1,
    'post_status' => 'any',
    'post_parent' => $post->ID,
    'exclude'     => get_post_thumbnail_id(),
);

$attachments = get_posts( $args );

if ( $attachments ) {
    foreach ( $attachments as $attachment ) {
        echo apply_filters( 'the_title', $attachment->post_title );
        the_attachment_link( $attachment->ID, false );
    }
}

?>

or put this code in single.php

<ul>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();    
//add in bootom of loops
 $args = array(
   'post_type' => 'attachment',
   'numberposts' => -1,
   'post_status' => null,
   'post_parent' => $post->ID
  );

  $attachments = get_posts( $args );
     if ( $attachments ) {
        foreach ( $attachments as $attachment ) {
           echo '<li>';
           the_attachment_link( $attachment->ID, true );
           echo '<p>';
           echo apply_filters( 'the_title', $attachment->post_title );
           echo '</p></li>';
          }
     }

 endwhile; endif; ?>
</ul>

the code return http://wp.example.net/post_name/attachment_name.
this is the reference https://codex.wordpress.org/Function_Reference/get_attachment_link