D:
/
vhosts
/
kolejfm.com.tr
/
admin.kolejfm.com.tr
/
Views
/
Settings
/
Upload File
HOME
@{ ViewBag.Title = "Logo"; Layout = "~/Views/Shared/_LayoutPage1.cshtml"; } <head> <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <link href="~/Content/toastr.min.css" rel="stylesheet" /> <script src="~/Scripts/tinymce/tinymce.min.js"></script> <script type="text/javascript"> tinymce.init({ selector: 'textarea' }); </script> <style> .switch { position: relative; display: block; vertical-align: top; width: 100px; height: 30px; padding: 3px; margin: 0 10px 10px 0; background: linear-gradient(to bottom, #eeeeee, #FFFFFF 25px); background-image: -webkit-linear-gradient(top, #eeeeee, #FFFFFF 25px); border-radius: 18px; box-shadow: inset 0 -1px white, inset 0 1px 1px rgba(0, 0, 0, 0.05); cursor: pointer; box-sizing: content-box; } .switch-input { position: absolute; top: 0; left: 0; opacity: 0; box-sizing: content-box; } .switch-label { position: relative; display: block; height: inherit; font-size: 10px; text-transform: uppercase; background: #eceeef; border-radius: inherit; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12), inset 0 0 2px rgba(0, 0, 0, 0.15); box-sizing: content-box; } .switch-label:before, .switch-label:after { position: absolute; top: 50%; margin-top: -.5em; line-height: 1; -webkit-transition: inherit; -moz-transition: inherit; -o-transition: inherit; transition: inherit; box-sizing: content-box; } .switch-label:before { content: attr(data-off); right: 11px; color: #aaaaaa; text-shadow: 0 1px rgba(255, 255, 255, 0.5); } .switch-label:after { content: attr(data-on); left: 11px; color: #FFFFFF; text-shadow: 0 1px rgba(0, 0, 0, 0.2); opacity: 0; } .switch-input:checked ~ .switch-label { background: #E1B42B; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15), inset 0 0 3px rgba(0, 0, 0, 0.2); } .switch-input:checked ~ .switch-label:before { opacity: 0; } .switch-input:checked ~ .switch-label:after { opacity: 1; } .switch-handle { position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; background: linear-gradient(to bottom, #FFFFFF 40%, #f0f0f0); background-image: -webkit-linear-gradient(top, #FFFFFF 40%, #f0f0f0); border-radius: 100%; box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2); } .switch-handle:before { content: ""; position: absolute; top: 50%; left: 50%; margin: -6px 0 0 -6px; width: 12px; height: 12px; background: linear-gradient(to bottom, #eeeeee, #FFFFFF); background-image: -webkit-linear-gradient(top, #eeeeee, #FFFFFF); border-radius: 6px; box-shadow: inset 0 1px rgba(0, 0, 0, 0.02); } .switch-input:checked ~ .switch-handle { left: 74px; box-shadow: -1px 1px 5px rgba(0, 0, 0, 0.2); } /* Transition ========================== */ .switch-label, .switch-handle { transition: All 0.3s ease; -webkit-transition: All 0.3s ease; -moz-transition: All 0.3s ease; -o-transition: All 0.3s ease; } </style> </head> <div class="row"> <div class="col-lg-12"> <div class="card"> <div class="card-header text-uppercase">Logo Ekle <small>Bu sayfa site de logo bilgileri bölümünde yayınlanacak</small></div> <div class="card-body"> <div class="x_content"> <div class="card-header"> <a href="/Settings/liste/"><button data-placement="top" data-toggle="tooltip" title="Logo Ekle" class="btn btn-primary btn-xs" style="font-size:x-small">Logo Listesi</button></a> </div> <br> @using (Html.BeginForm("ResimYukle", "Settings", FormMethod.Post, new { enctype = "multipart/form-data" })) { <div class="form-group"> <label>Birinci Slayt Resmi</label> <input type="file" name="Logoİmg" value="Logoİmg" id="Resim" class="form-control" multiple required /> <input type="hidden" name="Id" value="1" /> <br /> <br /> <br /> <div class="text-center" id="resimonizleme" style="display:none!important"> <h4 class="text-center">Resim Önizleme</h4> <img class="text-center" id="SecilecResim" style="height:15rem!important" /> </div> </div> <div class="In_solid"></div> <div class="form-group"> <div class="col-md-9 offset-md-3"> <button type="submit" class="btn btn-success" id="KadroEkle"> Kaydet</button> <button type="reset" class="btn btn-primary">Temizle</button> <button type="button" class="btn btn-primary">İptal</button> </div> </div> } </div> </div> </div> </div> </div> <script type="text/javascript"> debugger $("#Resim").change(function () { ResimOku(this); }); debugger function ResimOku(input) { debugger; if (input.files[0].width > 1800) //resim boyutunu kontrol ettik eğer seçilen resim 100 kb'tan büyük ise { alert("Resim Piksel 1800 * 548 Olmalıdır. "); //uyarı mesajı verdik $("#Resim").val(""); //resim seçmek için eklediğimiz input'un içerisinde daha önceden seçilen resim var ise onu kaldırdık $("#SecilecResim").attr('src', ""); //img src içerisinde eski seçilen resmi kaldırdık. return; } if (input.files && input.files[0]) //eğer Dosya seçilmiş ise { var reader = new FileReader(); //seçilen Dosyayı Okul reader.onload = function (e) //seçilen Dosyayı img src içerisine ata { $("#resimonizleme").show(); $('#SecilecResim').attr('src', e.target.result); } reader.readAsDataURL(input.files[0]); } } </script>