Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <button type="button" id="extrabutton" value="1" class="btn btn-lg btn-block btn-outline-success"><font><font>Начать загрузку</font></font></button>
- <script>
- $(document).ready(function() {
- var extraObj = $("#singleupload").uploadFile({
- url: "upload.php",
- fileName: "myfile",
- acceptFiles: "image/*",
- allowedTypes: "jpg,jpeg,png,gif",
- showPreview: true,
- multiple: false,
- previewHeight: "100px",
- maxFileCount: 1,
- previewWidth: "auto",
- showDelete: true,
- showFileCounter: false,
- returnType: "html",
- maxFileCountErrorStr: "Вы не можете загружать более одного изображения",
- statusBarWidth: 600,
- autoSubmit: false,
- dragdropWidth: 600,
- dragDropStr: "Перетащите файл или откройте ",
- abortStr: "Не загруженно",
- cancelStr: "Отмена",
- uploadStr: "Открыть",
- dynamicFormData: function() {
- var data = {
- login: $("#login").val(),
- password: $("#password").val(),
- firstname: $("#firstname").val(),
- lastname: $("#lastname").val(),
- position: $("#position").val(),
- specialization: $("#specialization").val(),
- number_Phone: $("#number_Phone").val(),
- email: $("#email").val(),
- education: $("#education").val(),
- attainment: $("#attainment").val(),
- about: $("#about").val(),
- extrabutton: $("#extrabutton").val()
- } //подготовил для передачи на сервер значение с кнопкой
- return data;
- },
- onSuccess: function(files, data, xhr, pd) {
- $("#eventsmessage").html($("#eventsmessage").html() + "Success for: " + JSON.parse(data));
- },
- onError: function(files, status, errMsg, pd) {
- alert("error");
- $("#display_messaggi").html(errMsg);
- },
- onSubmit: function(files) {
- //files : List of files to be uploaded
- //return flase; to stop upload
- }
- });
- $("#extrabutton").click(function() {
- extraObj.startUpload();
- });
- });
- </script>
- if(isset($_POST["extrabutton"]))
- {
Advertisement
Add Comment
Please, Sign In to add comment