Search code examples
phpsqldropzone

Dropzone.js upload using php does not follow through


I have a PHP and SQL code that uses Dropzone.js to try and upload photos and add to the database. My issue is that i get a error when I try to use the dropzone for a picture.

Heres my Dropzone div:

        <div class="col-md-4 bg-color-white shadow border-radius"><!-- Photos { -->
          <div class="row bg-color-dark-gold border-top-radius">
            <div class="col-md-12 color-white section-title-bar">
              <span class="ion-image"></span>&nbsp;&nbsp;&nbsp; PHOTO
            </div>
          </div>
          <div class="col-md-12 spacer"></div>

          <div class="col-md-12">
            <form action="for_lease_sale_photos_upload.php?i=<?php echo($rowProduct['productid']); ?>" class="dropzone"></form>
            <br>
          </div>

          <div class="col-md-12 spacer"></div>
        </div>

UI:

upload photo

If I try to drag a photo, my other codes do not follow through and get this error message:

error

[Deprecation] Resource requests whose URLs contained both removed whitespace 
(`\n`, `\r`, `\t`) characters and less-than characters (`<`) are blocked. m 
Please remove newlines and encode less-than characters from places like 
element attribute values in order to load these resources. See 
https://www.chromestatus.com/feature/5735596811091968 for more details.

I am confused why I get the error of "whitespace" and less-than characters because I do not seem to have those.

This is my page URL:

http://localhost/infinitygroup/cms/for_lease_photos_list.php?i=1

the i=1 is from my SQL statement

I was also told to check the "Network" tab in the developer tools to see if I can find the error there.There seems to be no less than or white space in any file.

Network

As seen in the screenshot, my photo is being blocked.

Will appreciate any help in solving my error. Thank you


Solution

  • Looking at the url that is being blocked, it does not match what you say the url is posting to. You say it is supposed to post to

        for_lease_photos_list.php?i=1 
    

    but just by looking at the url in the console screenshot you can see that there are other urlencoded characters present. We can see

        for_lease_photos_list.php?i=%3Cbr%20/%
    

    which decodes to

        for_lease_photos_list.php?i=<br /%
    

    Make sure that

        $rowProduct['productid']
    

    does actually contain a valid integer and not some other characters as seen above.