Ajax works on Chrome but not in android devices

Maybe this a newbie problem, so please bear with me.

I’m using AJAX to get a plan TXT file and do further processing. When I run the following code on Chrome it sends error code 200 (which is OK), but on any Android device (Phone/Tablet) gives back error code 0 and the word “error” as description.

archLot = Ajax(“http://www.site.net/descarga.php?catalogo=lot.TEST”, ProcessLot)

Function ProcessLot
If archLot.status = 200 Then
FillLotTable(archLot.responseText)
Else
MsgBox "Error: Status = " & archLot.status & vbCRLF & CStr(archLot.statusText ) & vbCRLF & archLot.error
End If
End Function

Chrome debugger gives me no errors nor warnings, and I don’t know how to debug the application on android devices.

I’ve been struggling with this for almost a month with no luck, so all help will be GREATLY appreciated.

Thanks

Hi,
In the last 6 months I’ve noticed you MUST have a CORS line in the server side script. Up until 6 months ago it wasnt needed.

Neil

In php it’s something like

header('Access-Control-Allow-Origin: *');

Thanks for your comments.
The script descarga.php already has that line, here’s the code:

<?php header('Access-Control-Allow-Origin: *'); $path = $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF']; $xx = $_GET['catalogo']; $arch = str_replace('descarga.php',$xx,$path); $ch = curl_init($arch); curl_setopt($ch, CURLOPT_URL, $arch); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // curl_setopt($ch, CURLOPT_HEADER, 0); $data = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } else { echo $data; } curl_close($ch); ?>
<?php header('Access-Control-Allow-Origin: *'); $path = $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF']; $xx = $_GET['catalogo']; $arch = str_replace('descarga.php',$xx,$path); $ch = curl_init($arch); curl_setopt($ch, CURLOPT_URL, $arch); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // curl_setopt($ch, CURLOPT_HEADER, 0); $data = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } else { echo $data; } curl_close($ch); ?>

Since you are not calling a php script, adding Access-Control-Allow-Origin: * would have no effect. However, I noticed that you are using http and not https. This may be the issue.

John