https://discord.gg/botpress logo
Hi everyone, I am developing a bot to answer our c...
# 💻developers
w
Hi everyone, I am developing a bot to answer our customers information from our website. The website contains A LOT of data (almost 8000 pages). We unfortunetlly cannot use node.js or any other technology than php because of limitations of client's server and it's hosting company... and now I need to update every page that had update in last 24 hours each day at 1 am. I am uploading files like this:
Copy code
php
  <?php
    function uploadFileFromUrl($nameOfFile, $urlToFile, $knowledgeBaseId) {
        global $token;
        global $botId;

        $postData = [
            'key' => $nameOfFile,
            'url' => $urlToFile,
            'index' => true,
            'accessPolicies' => [],
            'tags' => [
                'source' => 'knowledge-base',
                'kbId' => $knowledgeBaseId,
                'title' => $nameOfFile
            ],
            'size' => strlen(file_get_contents($urlToFile))
        ];

        return fetch("https://api.botpress.cloud/v1/files", [
            'method' => 'PUT',
            'headers' => [
                "Authorization: Bearer $token",
                "Accept: application/json",
                "Content-Type: application/json",
                "x-bot-id: $botId"
            ],
            'body' => json_encode($postData)
        ]);
    }
but whenever I upload a file like this inside knowledge base it appears with loader nearby and I can't preview it nor do anything about this file. When i uploaded this same files from node.js from my pc it worked perfectly fine. Does anybody know what is happening? Also: I had tested uploading big file (12mb xml file renamed to .html) that is kind of sitemap that contains info from each page and I had uploaded it in studio editor 33 minutes ago and similar to php upload it has this spinner and nothing else happens https://cdn.discordapp.com/attachments/1121494527727902891/1397524015937228830/image.png?ex=6882092a&is=6880b7aa&hm=261f4add2ee752dce3a853ffad19df12b9ccd5d7e5663b32600d6b2b35ef3c88& https://cdn.discordapp.com/attachments/1121494527727902891/1397524016293478482/image.png?ex=6882092a&is=6880b7aa&hm=426ac534486099cf9783ba9aeb1c689f1ef63f88e28341b14a2fbed48fc6bbbd&
2 Views