Guest User

Untitled

a guest
Dec 13th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. @using (Html.BeginForm("Index", "Home", FormMethod.Post, new { enctype = "multipart/form-data" }))
  2. {
  3. <span class="btn btn-success fileinput-button">
  4. <i class="glyphicon glyphicon-plus"></i>
  5. @Html.TextBoxFor(model => model.files, "", new { @type = "file", @id = "FileToLoad", @accept = "image/gif, image/jpg, image/jpeg, image/png" })
  6. <span>Upload Photo...</span>
  7. </span>
  8. <input type="submit" onclick="FillBillingValues();" id="submitfilteration" class="btn btn-default" value="Continue Checkout" />
  9. }
  10.  
  11. <Script>
  12. function readURL(input) {
  13. if (input.files && input.files[0]) {
  14. var reader = new FileReader();
  15. reader.onload = function (e) {
  16. $('#DecalLogo').attr('src', e.target.result);
  17. }
  18. reader.readAsDataURL(input.files[0]);
  19. }
  20. }
  21.  
  22. $("#imgInp").change(function () {
  23. readURL(this);
  24. });
  25. </Script>
  26.  
  27.  
  28. <img id="DecalLogo" name="DecalLogo" class="photo" ImageUrl="" />
  29. <label for="imgInp" class="custom-file-upload">
  30. <i class="fa fa-cloud-upload"></i>Upload Logo
  31. </label>
  32. <input type='file' id="imgInp" name="image" />
Add Comment
Please, Sign In to add comment