Guest User

Untitled

a guest
Jan 21st, 2017
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. <button type="button" id="extrabutton" value="1" class="btn btn-lg btn-block btn-outline-success"><font><font>Начать загрузку</font></font></button>
  2.  
  3. <script>
  4. $(document).ready(function() {
  5. var extraObj = $("#singleupload").uploadFile({
  6. url: "upload.php",
  7. fileName: "myfile",
  8. acceptFiles: "image/*",
  9. allowedTypes: "jpg,jpeg,png,gif",
  10. showPreview: true,
  11. multiple: false,
  12. previewHeight: "100px",
  13. maxFileCount: 1,
  14. previewWidth: "auto",
  15. showDelete: true,
  16. showFileCounter: false,
  17. returnType: "html",
  18. maxFileCountErrorStr: "Вы не можете загружать более одного изображения",
  19. statusBarWidth: 600,
  20. autoSubmit: false,
  21. dragdropWidth: 600,
  22. dragDropStr: "Перетащите файл или откройте ",
  23. abortStr: "Не загруженно",
  24. cancelStr: "Отмена",
  25. uploadStr: "Открыть",
  26. dynamicFormData: function() {
  27. var data = {
  28. login: $("#login").val(),
  29. password: $("#password").val(),
  30. firstname: $("#firstname").val(),
  31. lastname: $("#lastname").val(),
  32. position: $("#position").val(),
  33. specialization: $("#specialization").val(),
  34. number_Phone: $("#number_Phone").val(),
  35. email: $("#email").val(),
  36. education: $("#education").val(),
  37. attainment: $("#attainment").val(),
  38. about: $("#about").val(),
  39. extrabutton: $("#extrabutton").val()
  40. } //подготовил для передачи на сервер значение с кнопкой
  41. return data;
  42. },
  43. onSuccess: function(files, data, xhr, pd) {
  44. $("#eventsmessage").html($("#eventsmessage").html() + "Success for: " + JSON.parse(data));
  45. },
  46. onError: function(files, status, errMsg, pd) {
  47. alert("error");
  48. $("#display_messaggi").html(errMsg);
  49. },
  50. onSubmit: function(files) {
  51. //files : List of files to be uploaded
  52. //return flase; to stop upload
  53. }
  54. });
  55. $("#extrabutton").click(function() {
  56.  
  57. extraObj.startUpload();
  58.  
  59. });
  60. });
  61. </script>
  62.  
  63. if(isset($_POST["extrabutton"]))
  64. {
Advertisement
Add Comment
Please, Sign In to add comment