How to configure to eneble FETCH???

Problems with the Windows version of XAMPP, questions, comments, and anything related.

How to configure to eneble FETCH???

Postby jdearriba » 17. August 2017 08:18

I'm trying do get a file from my PC (xampp in localhost) to Google sites (using Google App Script). Allways turn Failed to Fetch
But if i call it works fine.
I think this is due to the configuration of my apache. Please, any ideas? :idea: What I can do? :?:

this is my code .htaccess

# Always set these headers.
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
Header always set Access-Control-Max-Age "1000"
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
# Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request.
RewriteEngine On
RewriteRule ^(.*)$ $1 [R=200,L]

this is Web Page in google site
function DoFetch()
var LaURL = 'http://localhost/fetch/smile.jpg';
.then(res => res.blob()) // Gets the response and returns it as a blob
.then(blob => {
let objectURL = URL.createObjectURL(blob);
let myImage = new Image();
myImage.src = objectURL;
}).catch(function(err) {
document.getElementById('myImg').innerHTML = err.message;
<div id="myImg"></div>
Posts: 1
Joined: 17. August 2017 07:56
XAMPP version: 3.2.2
Operating System: windows 7

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 41 guests