Uncaught error no url provided dropzone

This code throws an error, anyone know why? var upload_url = $("#dropzone-wrapper").data("url"); console.debug(upload_url.toString()); //I get the correct value here var myDropz...

my code which works

Dropzone.autoDiscover = false;  
$("#compose").dropzone({
paramName: "file",
hiddenInputContainer: "#file-uploader .addfile",
autoProcessQueue: false,
addRemoveLinks : true,
renderMethod: "prepend",
dictDefaultMessage: "Add Photo",
previewsContainer: "#file-uploader",
clickable : "#file-uploader .addfile",
previewTemplate: "<div class="pic dz-preview dz-file-preview">n  <div class="dz-image"><img data-dz-thumbnail /></div>n  <div class="dz-details">n    <div class="dz-size"><span data-dz-size></span></div>n    <div class="dz-filename"><span data-dz-name></span></div>n  </div>n  <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>n  <div class="dz-error-message"><span data-dz-errormessage></span></div>n  <div class="dz-success-mark">n    <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">n      <title>Check</title>n      <defs></defs>n      <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">n<path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" stroke-opacity="0.198794158" stroke="#FFFFFF" fill-opacity="0.816519475" fill="#32A336" sketch:type="MSShapeGroup"></path>n      </g>n    </svg>n  </div>n  <div class="dz-error-mark">n    <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">n      <title>Error</title>n      <defs></defs>n      <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">n<g id="Check-+-Oval-2" sketch:type="MSLayerGroup" stroke="#FFFFFF" stroke-opacity="0.198794158" fill="#ff0000" fill-opacity="0.816519475">n  <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" sketch:type="MSShapeGroup"></path>n</g>n      </g>n    </svg>n  </div>n</div>",
RemoveLinkTemplate: "<div class="remove" data-dz-remove><i class="icon-cross"></i></div>",

init: function() {
var submitButton = document.querySelector("#post-create .post-btn");
myDropzone = this; // closure

submitButton.addEventListener("click", function() {
myDropzone.processQueue(); // Tell Dropzone to process all queued files.
});

}
});

Содержание

  1. Uncaught Error: No URL provided. #94
  2. Comments
  3. Footer
  4. Dropzone: Uncaught Error: URL не указан
  5. Dropzone: Uncaught Error: URL не указан
  6. Dropzone: Неперехваченная ошибка: URL не указан
  7. Uncaught Error: No URL provided. about ngx-dropzone HOT 2 CLOSED
  8. Comments (2)
  9. Related Issues (20)
  10. Recommend Projects
  11. React
  12. Vue.js
  13. Typescript
  14. TensorFlow
  15. Django
  16. Laravel
  17. Recommend Topics
  18. javascript
  19. server
  20. Machine learning
  21. Visualization
  22. Recommend Org
  23. Facebook
  24. Microsoft

Uncaught Error: No URL provided. #94

This exception is thrown (even though everything works).

This happens even with the most basic code:
<>

I’m guessing this is related to: dropzone/dropzone#1355

The text was updated successfully, but these errors were encountered:

It looks like the autodiscover did its work before this line was executed. The exception is gone when I copy it to the root of the file, in the module scope. As I’m fairly new to Ember, I’m not sure where this kind of config should be added in the codebase, otherwise, I could make the PR.

Hi @NindroidX, sorry for the late response, I’ve been busy. Anyway, I would love to help out but I need more context on this issue. Is there a way I could recreate this issue, I’m currently unable to recreate it.

Hey! No problem :D.

It seems like a fastboot problem. When I disable fastboot with &fastboot=false the error does not appear. I assume it’s because fastboot renders the html structure on the server, and Dropzone tries to initialise it because it contains the default .dropzone class.

What ember-cli version are you using?

Closed due to inactivity

I’m also seeing this error and can confirm it goes away if you disable fastboot. Using ember-cli 3.4.3 + ember-cli-fastboot 2.0.0.

I’m wondering if Dropzone should run at all in fastboot?

run into the same issue with fastboot

© 2023 GitHub, Inc.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Dropzone: Uncaught Error: URL не указан

У меня есть следующая форма:

Я включаю библиотеку dropzone.js следующим образом:

И моя собственная dropzone myDropzone.js:

В файле myDropzone.js я сконфигурировал div # pdfFile следующим образом:

При загрузке страницы я получаю сообщение об ошибке:

Ошибка поиска: не указана ссылка.

Ранее я модифицировал dropzone.js файл для установки опций Dropzone, но сбросить файл библиотеки dropzone.js и решил настроить параметры в myDropzone.js файл.

Когда параметры были установлены в файле dropzone.js, у меня не было ошибок, но после того, как я их сбросил, и настроил их в myDropzone.js, у меня была эта ошибка, из-за чего я полагаю, что параметры не инициализируются в myDropzone.js,

Факт в том, что функция init() работает правильно, когда я нажимаю кнопку # submit-all.

Любая идея о том, как решить проблему, пожалуйста?

Ошибка поиска: не указана ссылка.

Теперь, когда я отправляю сообщение, я получаю следующую ошибку:

Uncaught TypeError: myDropzone.processQueue не является функцией

Редактировать:

Я решил последнюю предыдущую ошибку, удалив функцию processQueue и заблокировав кнопку Validate моей страницы загрузки, пока файл PDF не будет загружен успешно. Я знаю, что это уродливый хак, но я не понял другого способа сделать это.

Источник

Dropzone: Uncaught Error: URL не указан

У меня есть следующая форма:

Я включаю библиотеку dropzone.js следующим образом:

И моя собственная dropzone myDropzone.js:

В файле myDropzone.js я сконфигурировал div # pdfFile следующим образом:

При загрузке страницы я получаю сообщение об ошибке:

Ошибка поиска: не указана ссылка.

Ранее я модифицировал dropzone.js файл для установки опций Dropzone, но сбросить файл библиотеки dropzone.js и решил настроить параметры в myDropzone.js файл.

Когда параметры были установлены в файле dropzone.js, у меня не было ошибок, но после того, как я их сбросил, и настроил их в myDropzone.js, у меня была эта ошибка, из-за чего я полагаю, что параметры не инициализируются в myDropzone.js,

Факт в том, что функция init() работает правильно, когда я нажимаю кнопку # submit-all.

Любая идея о том, как решить проблему, пожалуйста?

Ошибка поиска: не указана ссылка.

Теперь, когда я отправляю сообщение, я получаю следующую ошибку:

Uncaught TypeError: myDropzone.processQueue не является функцией

Редактировать:

Я решил последнюю предыдущую ошибку, удалив функцию processQueue и заблокировав кнопку Validate моей страницы загрузки, пока файл PDF не будет загружен успешно. Я знаю, что это уродливый хак, но я не понял другого способа сделать это.

Источник

Dropzone: Неперехваченная ошибка: URL не указан

У меня следующая форма:

Я включаю библиотеку dropzone.js вот так:

И моя собственная dropzone myDropzone.js:

В myDropzone.js файле я настроил div # pdfFile следующим образом:

При загрузке страницы получаю ошибку:

Uncaught Error: No URL provided.

Ранее, я изменил dropzone.js файл для настройки параметров Dropzone, но сбросить dropzone.js файл библиотеки и решил настроить параметры в myDropzone.js файле.

Когда параметры были настроены в файле dropzone.js , у меня не было ошибок, но после того, как я сбросил их и настроил их в myDropzone.js , у меня была эта ошибка, которая заставляет меня думать, что параметры не инициализируются в myDropzone.js .

Дело в том, что функция init () работает правильно, когда я нажимаю кнопку # submit-all .

Есть идеи, как решить проблему?

Uncaught Error: No URL provided.

Теперь, когда я отправляю, я получаю следующую ошибку:

Uncaught TypeError: myDropzone.processQueue is not a function

Редактировать:

Я решил последнюю предыдущую ошибку, удалив функцию processQueue и блокирует Validate кнопки моей страницы загрузки, пока PDF не был загружен успешно. Я знаю, что это уродливый взлом, но я не придумал другого способа сделать это.

Источник

Uncaught Error: No URL provided. about ngx-dropzone HOT 2 CLOSED

thanks for your feedback.
Could you please post all of the code you use concerning the dropzone?
What file (name/type/size) are you dropping?

ajlonsdale commented on January 16, 2023

Hi, unfortunately i have had to move onto a different plugin so no longer have the code for this.

It was however the basic setup only using and the error message was displayed before trying to upload anything.

I’ve used dropzone before and i know you need to specify a URL otherwise it will display this message however there is no option to specify an upload URL.

I’ll keep an eye out here because i like the implementation of your version i just don’t want the console errors.

Let me know if you need anymore info!

  • Looks awful HOT 1
  • Video thumbnail/image not appearing when file is uploaded HOT 1
  • Angular 13 Support HOT 3
  • Certain file types will have empty types in the upload event HOT 2
  • unit tests in jest fail with with latest build HOT 4
  • Can’t import the named export HOT 2
  • Drop file should be disabled when [multiple]=»false» HOT 1
  • image preview does not work with svg HOT 2
  • Dropdown Area not Responsive, Image Getting Smaller & Not Scrollable HOT 1
  • Custom preview needs clarification — How on earth should we provide a view/edit option for loading only fileUrls? — HOT 2
  • Angular 14
  • ngx-dropzone property [multiple] is not working HOT 3
  • The ‘Interpunct’-character seems not be supported in filenames HOT 2
  • Relative Path and Recursive HOT 1
  • Theming issue within Material HOT 1
  • No svg preview support
  • Why position absolute on a hidden element?
  • Project fails to build when ngx-dropzone 3.1.0 used in a library HOT 1
  • Latest version available for each version of Angular
  • Apple «pages» and «numbers» files always rejected

Recommend Projects

React

A declarative, efficient, and flexible JavaScript library for building user interfaces.

Vue.js

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

Typescript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

TensorFlow

An Open Source Machine Learning Framework for Everyone

Django

The Web framework for perfectionists with deadlines.

Laravel

A PHP framework for web artisans

Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

javascript

JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

Some thing interesting about web. New door for the world.

server

A server is a program made to process requests and deliver data to clients.

Machine learning

Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

Visualization

Some thing interesting about visualization, use data art

Some thing interesting about game, make everyone happy.

Recommend Org

Facebook

We are working to build community through open source technology. NB: members must have two-factor auth.

Microsoft

Open source projects and samples from Microsoft.

Источник

  • Remove From My Forums
  • Question

  • User-1499457942 posted

    Hi

      When i am using Dropzone with Tabs i am getting this error . Without Tabs it is working fine.

    @using (Html.BeginForm("Create", "Products", FormMethod.Post, new { enctype = "multipart/form-data", @class = "dropzone", id = "dropzoneJsForm" }))
    {
    
        @Html.AntiForgeryToken()
        <div id="tabs" class="form-horizontal">
            <ul>
                <li><a href="#tabs-1">Basic Info</a></li>
                <li><a href="#tabs-2">Others</a></li>
                <li><a href="#tabs-3">Images</a></li>
            </ul>
            <div id="tabs-1">
                <div class="row field">
                    @Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "four wide column" })
                    <div class="eight wide column">
                        @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "ui input icon" } })
                        @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })
                    </div>
                </div>
    
                <div class="row field">
                    @Html.LabelFor(model => model.ShortDescription, htmlAttributes: new { @class = "four wide column" })
                    <div class="eight wide column">
                        @Html.EditorFor(model => model.ShortDescription, new { htmlAttributes = new { @class = "ui input icon" } })
                        @Html.ValidationMessageFor(model => model.ShortDescription, "", new { @class = "text-danger" })
                    </div>
                </div>
    
                
            </div>
            <div id="tabs-2">
                <div class="form-group">
                    @Html.LabelFor(model => model.CategoryID, "CategoryID", htmlAttributes: new { @class = "control-label col-md-2" })
                    <div class="col-md-10">
                        @Html.DropDownList("CategoryID", null, htmlAttributes: new { @class = "form-control" })
                        @Html.ValidationMessageFor(model => model.CategoryID, "", new { @class = "text-danger" })
                    </div>
                </div>
                <div class="row field">
                    @Html.LabelFor(model => model.Price, htmlAttributes: new { @class = "four wide column" })
                    <div class="eight wide column">
                        @Html.EditorFor(model => model.Price, new { htmlAttributes = new { @class = "ui input icon" } })
                        @Html.ValidationMessageFor(model => model.Price, "", new { @class = "text-danger" })
                    </div>
                </div>
            </div>
            <div id="tabs-3">
                <div class="row field">
                    <div id="tabs-3" class="dropzone dz-default dz-message dz-drag-hover">
                        <h3>Drop files here or click to Upload</h3>
                        <div id="dropZoneContainer">
    
                        </div>
                    </div>
                </div>
            </div>
            
        </div>
        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="button" value="Create" class="btn btn-default" id="submitAll" />
            </div>
        </div>
    }
    
    <script src="~/Scripts/dropzone/dropzone.js"></script>
    <script type="text/javascript">
        Dropzone.options.dropzoneJsForm = { // Remember to change the form id to dropzoneJsForm
            autoProcessQueue: false,
            uploadMultiple: true,
            hiddenInputContainer: "#tabs-3",
            previewsContainer: "#dropZoneContainer",
            parallelUploads: 10,
    
            init: function () {
                var submitButton = document.querySelector("#submitAll"); 
                var myDropzone = this; 
    
                submitButton.addEventListener("click", function () {
    
                    myDropzone.processQueue();
                });
            },
            clickable: '#tabs-3'
        };
    
        
    </script>
    

    Thanks

Answers

  • User-691209617 posted

    Hi JagjitSingh,

    You just need to remove the dropzone class from the div#tabs-3. Also you repeated the id ‘tabs-3’ which may cause problems. You need to do the following modifications

    <div id="tabs-3">
                <div class="row field">
                    <div id="dropzoneWrapper" class="dz-default dz-message dz-drag-hover">
                        <h3>Drop files here or click to Upload</h3>
                        <div id="dropZoneContainer">
    
                        </div>
                    </div>
                </div>
            </div>
    hiddenInputContainer: "#dropzoneWrapper",
    clickable: '#dropzoneWrapper'

    Hope this resolves the issue.

    • Marked as answer by

      Thursday, October 7, 2021 12:00 AM

I have following form:

<form class="block-center" id="pdfForm" method="POST" action="form_threatment.php" enctype="multipart/form-data" style="margin-top: 30px;">    
  <div class="form-group push-50-t col-md-12">
    <div class="col-md-12">
      <div class="form-material form-material-primary">    
        <div class="dropzone dropzone-previews" id="pdfFile">
        </div>    
      </div>
    </div>
  </div>    
</div>

<div class="form-group push-50-t col-md-6">
  <div class="col-md-12">
    <div class="form-material form-material-primary">                               
      <input class="form-control" name="first_name" type="text" id="first_name" />
      <label for="first_name"><span class="asterix">*</span> Prénom : </label>                      
    </div>
  </div>
</div>

I include dropzone.js library like this :

<script src="assets/js/dropzone.js"></script>

And my own dropzone myDropzone.js :

<script src="assets/js/myDropzone.js"></script>

In the myDropzone.js file I have configured the div#pdfFile this way :

Dropzone.autoDiscover = false;

$(document).ready(function() {      

    Dropzone.options.pdfFile = {
        // url does not has to be written if we have wrote action in the form tag but i have mentioned here just for convenience sake 
        url: 'form_threatment.php',
        acceptedFiles: '.pdf',
        maxFilesize: 20,
        addRemoveLinks: true,
        autoProcessQueue: false, // this is important as you dont want form to be submitted unless you have clicked the submit button
        uploadMultiple: false,
        autoDiscover: false,
        paramName: 'pdf', // this is optional Like this one will get accessed in php by writing $_FILE['pic'] // if you dont specify it then by default it taked 'file' as paramName eg: $_FILE['file'] 
        previewsContainer: '#pdfFile', // we specify on which div id we must show the files
        clickable: false, // this tells that the dropzone will not be clickable . we have to do it because v dont want the whole form to be clickable 

        accept: function(file, done) {
            console.log("uploaded");
            done();
        },
        error: function(file, msg){
            alert(msg);
        },
        init: function() {
            var myDropzone = this;

            // #submit-all it the id of the submit button
            $("#submit-all").on("click", function(e) {
                var files = $('#pdfFile').get(0).dropzone.getAcceptedFiles();
                console.log(myDropzone);
                console.log(files);
                //e.preventDefault();
                //e.stopPropagation();
                myDropzone.processQueue(); // this will submit your form to the specified action path
                // after this, your whole form will get submitted with all the inputs + your files and the php code will remain as usual 
                //REMEMBER you DON'T have to call ajax or anything by yourself, dropzone will take care of that

            });                                             
        }
    };
    Dropzone.options.pdfFile.init();
});

When loading the page, I get the error:

Uncaught Error: No URL provided.

Earlier, I had modified the dropzone.js file to setup the Dropzone options, but I reset the dropzone.js library file and decided to setup the options in myDropzone.js file.

When the options were set up in the dropzone.js file, I had no error but after I reset these, and setup them in myDropzone.js, I had this error, which makes me believe the options aren’t initialized in myDropzone.js.

Fact is, the init() function works properly when I click on the #submit-all button.

Any idea on how to solve the problem please?


Okay, I solved the :

Uncaught Error: No URL provided.

by deleting it.

Now, when I submit, I get the following error:

Uncaught TypeError: myDropzone.processQueue is not a function

in the init() function.

Edit:

I solved the last previous error, by deleting the processQueue function, and blocking the Validate button of my upload page, until the PDF has not been uploaded succesfully.
I know it’s an ugly hack, but I didn’t figure out another way to do it.

У меня есть следующая форма:

<form class="block-center" id="pdfForm" method="POST" action="form_threatment.php" enctype="multipart/form-data" style="margin-top: 30px;">    
  <div class="form-group push-50-t col-md-12">
    <div class="col-md-12">
      <div class="form-material form-material-primary">    
        <div class="dropzone dropzone-previews" id="pdfFile">
        </div>    
      </div>
    </div>
  </div>    
</div>

<div class="form-group push-50-t col-md-6">
  <div class="col-md-12">
    <div class="form-material form-material-primary">                               
      <input class="form-control" name="first_name" type="text" id="first_name" />
      <label for="first_name"><span class="asterix">*</span> Prénom : </label>                      
    </div>
  </div>
</div>

Я включаю библиотеку dropzone.js следующим образом:

<script src="assets/js/dropzone.js"></script>

И моя собственная dropzone myDropzone.js:

<script src="assets/js/myDropzone.js"></script>

В файле myDropzone.js я сконфигурировал div # pdfFile следующим образом:

Dropzone.autoDiscover = false;

$(document).ready(function() {      

    Dropzone.options.pdfFile = {
        // url does not has to be written if we have wrote action in the form tag but i have mentioned here just for convenience sake 
        url: 'form_threatment.php',
        acceptedFiles: '.pdf',
        maxFilesize: 20,
        addRemoveLinks: true,
        autoProcessQueue: false, // this is important as you dont want form to be submitted unless you have clicked the submit button
        uploadMultiple: false,
        autoDiscover: false,
        paramName: 'pdf', // this is optional Like this one will get accessed in php by writing $_FILE['pic'] // if you dont specify it then by default it taked 'file' as paramName eg: $_FILE['file'] 
        previewsContainer: '#pdfFile', // we specify on which div id we must show the files
        clickable: false, // this tells that the dropzone will not be clickable . we have to do it because v dont want the whole form to be clickable 

        accept: function(file, done) {
            console.log("uploaded");
            done();
        },
        error: function(file, msg){
            alert(msg);
        },
        init: function() {
            var myDropzone = this;

            // #submit-all it the id of the submit button
            $("#submit-all").on("click", function(e) {
                var files = $('#pdfFile').get(0).dropzone.getAcceptedFiles();
                console.log(myDropzone);
                console.log(files);
                //e.preventDefault();
                //e.stopPropagation();
                myDropzone.processQueue(); // this will submit your form to the specified action path
                // after this, your whole form will get submitted with all the inputs + your files and the php code will remain as usual 
                //REMEMBER you DON'T have to call ajax or anything by yourself, dropzone will take care of that

            });                                             
        }
    };
    Dropzone.options.pdfFile.init();
});

При загрузке страницы я получаю сообщение об ошибке:

Ошибка поиска: не указана ссылка.

Ранее я модифицировал dropzone.js файл для установки опций Dropzone, но сбросить файл библиотеки dropzone.js и решил настроить параметры в myDropzone.js файл.

Когда параметры были установлены в файле dropzone.js, у меня не было ошибок, но после того, как я их сбросил, и настроил их в myDropzone.js, у меня была эта ошибка, из-за чего я полагаю, что параметры не инициализируются в myDropzone.js,

Факт в том, что функция init() работает правильно, когда я нажимаю кнопку # submit-all.

Любая идея о том, как решить проблему, пожалуйста?


Хорошо, я решил:

Ошибка поиска: не указана ссылка.

удалив его.

Теперь, когда я отправляю сообщение, я получаю следующую ошибку:

Uncaught TypeError: myDropzone.processQueue не является функцией

в функции init().

Редактировать:

Я решил последнюю предыдущую ошибку, удалив функцию processQueue и заблокировав кнопку Validate моей страницы загрузки, пока файл PDF не будет загружен успешно. Я знаю, что это уродливый хак, но я не понял другого способа сделать это.

I have following form:

<form class="block-center" id="pdfForm" method="POST" action="form_threatment.php" enctype="multipart/form-data" style="margin-top: 30px;">    
  <div class="form-group push-50-t col-md-12">
    <div class="col-md-12">
      <div class="form-material form-material-primary">    
        <div class="dropzone dropzone-previews" id="pdfFile">
        </div>    
      </div>
    </div>
  </div>    
</div>

<div class="form-group push-50-t col-md-6">
  <div class="col-md-12">
    <div class="form-material form-material-primary">                               
      <input class="form-control" name="first_name" type="text" id="first_name" />
      <label for="first_name"><span class="asterix">*</span> Prénom : </label>                      
    </div>
  </div>
</div>

I include dropzone.js library like this :

<script src="assets/js/dropzone.js"></script>

And my own dropzone myDropzone.js :

<script src="assets/js/myDropzone.js"></script>

In the myDropzone.js file I have configured issuse uvdos dropzone.js the div#pdfFile this way :

Dropzone.autoDiscover = false;

$(document).ready(function() {      

    Dropzone.options.pdfFile = {
        // url does not has to be written if we have wrote action in the form tag but i have mentioned here just for convenience sake 
        url: 'form_threatment.php',
        acceptedFiles: '.pdf',
        maxFilesize: 20,
        addRemoveLinks: true,
        autoProcessQueue: false, // this is important as you dont want form to be submitted unless you have clicked the submit button
        uploadMultiple: false,
        autoDiscover: false,
        paramName: 'pdf', // this is optional Like this one will get accessed in php by writing $_FILE['pic'] // if you dont specify it then by default it taked 'file' as paramName eg: $_FILE['file'] 
        previewsContainer: '#pdfFile', // we specify on which div id we must show the files
        clickable: false, // this tells that the dropzone will not be clickable . we have to do it because v dont want the whole form to be clickable 

        accept: function(file, done) {
            console.log("uploaded");
            done();
        },
        error: function(file, msg){
            alert(msg);
        },
        init: function() {
            var myDropzone = this;

            // #submit-all it the id of the submit button
            $("#submit-all").on("click", function(e) {
                var files = $('#pdfFile').get(0).dropzone.getAcceptedFiles();
                console.log(myDropzone);
                console.log(files);
                //e.preventDefault();
                //e.stopPropagation();
                myDropzone.processQueue(); // this will submit your form to the specified action path
                // after this, your whole form will get submitted with all the inputs + your files and the php code will remain as usual 
                //REMEMBER you DON'T have to call ajax or anything by yourself, dropzone will take care of that

            });                                             
        }
    };
    Dropzone.options.pdfFile.init();
});

When loading the page, I get the error:

Uncaught Error: No URL provided.

Earlier, I had modified the dropzone.js file issuse uvdos dropzone.js to setup the Dropzone options, but I reset issuse uvdos dropzone.js the dropzone.js library file and decided to issuse uvdos dropzone.js setup the options in myDropzone.js file.

When the options were set up in the issuse uvdos dropzone.js dropzone.js file, I had no error but after I issuse uvdos dropzone.js reset these, and setup them in issuse uvdos dropzone.js myDropzone.js, I had this error, which makes issuse uvdos dropzone.js me believe the options aren’t initialized in issuse uvdos dropzone.js myDropzone.js.

Fact is, the init() function works properly issuse uvdos dropzone.js when I click on the #submit-all button.

Any idea on how to solve the problem please?


Okay, I solved the :

Uncaught Error: No URL provided.

by deleting it.

Now, when I submit, I get the following issuse uvdos dropzone.js error:

Uncaught TypeError: myDropzone.processQueue issuse uvdos dropzone.js is not a function

in the init() function.

Edit:

I solved the last previous error, by issuse uvdos dropzone.js deleting the processQueue function, and issuse uvdos dropzone.js blocking the Validate button of my upload issuse uvdos dropzone.js page, until the PDF has not been uploaded issuse uvdos dropzone.js succesfully.
I know it’s an ugly hack, but I issuse uvdos dropzone.js didn’t figure out another way to do it.

32

Answers 1 : of Dropzone : Uncaught Error: No URL provided

I think of 3 things :
Your main dropzone solved uvdos dropzone.js element (where you DROP) is #pdfForm
And solved uvdos dropzone.js you want the previews in #pdfFiles. That solved uvdos dropzone.js said :

1) code must be Dropzone.options.pdfForm solved uvdos dropzone.js and not Dropzone.options.pdfFile

2) Dropzone.options.pdfForm is a right solved uvdos dropzone.js syntax when autodiscover is let to true solved uvdos dropzone.js (default). But if tou want autodiscover solved uvdos dropzone.js to false, you might try :var myDropzone solved uvdos dropzone.js = new Dropzone(«#pdfForm», { url: solved uvdos dropzone.js «form_threatment.php», other options… solved uvdos dropzone.js // JS : Dropzone class solved uvdos dropzone.js or
$(«#pdfForm»).dropzone({ url: solved uvdos dropzone.js «form_threatment.php», other options… solved uvdos dropzone.js // JS : jquery style

3) If you specify «form_threatment.php» solved uvdos dropzone.js in JS, you don’t have to do it in HTML. solved uvdos dropzone.js Then you can remove solved uvdos dropzone.js action=»form_threatment.php» from the solved uvdos dropzone.js form

see also my other answer for possible solved uvdos dropzone.js problems with jQuery version 3 if you solved uvdos dropzone.js decide to use autodiscover=true solved uvdos dropzone.js (defalut) : Why is my dropzone solved uvdos dropzone.js javascript form not working?

0

2023-02-07T04:48:43+00:00 2023-02-07T04:48:43+00:00Answer Link

mRahman

Понравилась статья? Поделить с друзьями:
  • Uncaught error no element is specified to initialize perfectscrollbar
  • Uncaught error map container is already initialized
  • Uncaught error createroot target container is not a dom element
  • Uncaught error invalidstateerror the connection has not been established yet
  • Uncaught error class memcache not found in