无法从路径检索图像

I have some issue with displaying my image. When I try to upload images with hash character in name like: Dragon's3-#2.jpg, it doesn't load. I already checked for double quotes, if they could be the reason, but they are not. Here is my view:

    <div class="row">
    <div class="col col-54">
        <div class="box-advert-img radius-5 js_advert_box">your advertisement</div>
        <input type="hidden" name="path" class='js_advert_file_val'>
    </div>
    <div class="col col-46">
        <div class="box-new-logo border radius-5 wid_155">
            <input type="file" class='js_advert_file' required="">
                <i class="fa fa-picture-o" aria-hidden="true"></i>
                    Upload image
        </div>
        <div class="service__text service__text_pad">
            File: JPG, PNG<br> Size: 180х60, up to 700Kb
        </div>
    </div>

And the ajax:

  $('.js_advert_file').change(function(){
    var file = $(this);
    var formData = new FormData();
    formData.append( 'advert', $(this)[0].files[0] );
    $.ajax({
        url: "/back-door/advert/ajax-image",
        type: 'POST',
        data: formData,
        async: true,
        success: function (data) {
            console.log(data);
            if (data!='0' && data!='1') {
                $('.js_advert_box').css('padding', '0');
                $('.js_advert_box').empty();
                $('.js_advert_box').append('<img src="'+data+'" style="width: 100%;" />');

                $('.js_advert_file_val').val(data);
            }
        },
        cache: false,
        contentType: false,
        processData: false
    });
});

Here is the error log:

Error log

The hash character is a special character in URLs.

Hash characters in URLs indicate fragments, and the content following after a hash character is not sent to the server as part of the request. It's available to the client page, and can be referenced and used by scripts, but the server will not receive the content beyong that point. So for example, if you have a URL along the lines of:

http://www.fake.org/folder/image#name.jpg

...only the part up to the # character will actually be sent to the server to retrieve the file. It will look in this case for http://www.fake.org/folder/image, fail to find it, and throw an error very much like the one you linked to.

To work around this, you could URL encode the request to the image, eliminating the hash-tag from the URL that you're referencing in your scripting, but I would prefer to process the image name itself when saving the file (also eliminating other bad characters). That will keep the file-names in a form that is generally web-friendly, and makes it easier to avoid problems later.