Upload Photo/File
// GET PHOTO
$(function () {
var wrapper = $(".attachInput"),
inp = wrapper.find("input"),
lbl = wrapper.find("span");
var file_api = (window.File && window.FileReader && window.FileList && window.Blob) ? true : false;
inp.change(function () {
var file_name = "";
if (file_api && inp[0].files[0]) {
if (inp[0].files.length > 1) {
file_name = "Выбрано файлов: " + inp[0].files.length;
} else {
file_name = inp[0].files[0].name;
}
} else
file_name = inp.val().replace("C:\\fakepath\\", '');
if (!file_name.length) return;
lbl.text(file_name);
}).change();
});<label class="attach attachInput">
<span>Загрузите ваше фото</span>
<input type="file" name="photo" class="photo" accept="image/*" required />
</label>