Home GET http 403 forbidden (adding pictrues with AJAX)
Reply: 0

GET http 403 forbidden (adding pictrues with AJAX)

piterpiter
1#
piterpiter Published in 2018-01-12 11:23:45Z

I have a problem: after uploading files (via FileZilla) to the server, I do not get photos, and the console throws an error GET http://...... 403 (Forbidden) [console error image]

"galleryEach.js" script is responsible for downloading photos from folders and then uploading them to a specific div

Here is galleryEach.js code I use:

const name=[['bledow', 'Dom w Błędowie'],
            ["czestochowa-lo", "III LO Częstochowa"],
            ["dabrowa-zielona", "Dworek w Dąbrowie Zielonej"],
            ["gliwice", "Gliwice"],
            ["inne", "Inne realizacje"],
            ["kamienica-czestochowa", "Kamienica Częstochowa"],
            ["kamienica-siewierz", "Kamienica w Siewierzu"],
            ["klobuck","Dom w Kłobucku"],
            ["lazy","Dom w Łazach"],
            ["maslonskie","Dom Masłońskie"],
            ["myslow","Mysłów"],
            ["myszkow","Dom w Myszkowie"],
            ["ogrodzieniec","Dom w Ogrodzieńcu"],
            ["ogrodzieniec-2","Dom w Ogrodzieńcu(2)"],
            ["podlipie","Podlipie"],
            ["podzamcze","Dom w Podzamczu"],
            ["poreba","Dom w Porębie"],
            ["przeczyce","Dom w Przeczycach"],
            ["przedszkole-lazy", "Przedszkole w Łazach"],
            ["sarnow","Dom w Sarnowie"],
            ["siemonia","Siemonia"],
            ["siewierz","Dom w Siewierzu"],
            ["slawkow","Sławków"],
            ["zabkowice","Ząbkowice"],
            ["zawiercie","Dom w Zawierciu"],
            ["zawiercie-2","Dom w Zawierciu(2)"],
            ["zelislawice", "Dom w Żelisławicach"],
            ["zlotoryja","Złotoryja - blok mieszkalny"]];  

var counter=0;
function loadImg()
{
    var folder;

    folder = "/img/mini/"+name[counter][0]+"/";


    var folderGallery = folder.replace("mini", "gallery");

    $.ajax({

        url : folder,
        success: function (data) {

                $(data).find("a").attr("href", function (i, val) {
                if( val.match(/\.(jpe?g|png|gif|JPE?G)$/) ) { 
                    $("#foty").append( "<div class='gallery_product col-lg-4 col-md-4 col-sm-6 col-xs-6 filter "+name[counter][0]+"'><a href='"+ folderGallery + val +"' data-lightbox='"+name[counter][0]+"' data-title='"+name[counter][1]+"'><img src='"+ folder + val +"'  width=300 height=300 title='"+name[counter][1]+"' data-title='"+name[counter][1]+"' class=' img-responsive gallery_image'></div>" );

                } 
            });



        },
        error: function() {
            console.error("error");
        },
        complete: function() {

            counter++;

            if(counter<name.length)
                {
                    loadImg();
                }

        }


    });

}

loadImg();

at the local XAMPP everything works fine.

Is this about file access rights? What should I do? How can I change them?

Can anyone help me?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.304151 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO