can i read local server file ?
-
- Posts: 120
- Joined: Tue Jun 14, 2016 7:17 pm
can i read local server file ?
hi , i am trying read some file .txt in local server ... but when i call command > readString , dont get any string ...
Re: can i read local server file ?
this doesn't work with JavaScript. You need to call a server-side script.skinkairewalker wrote:hi , i am trying read some file .txt in local server ...
SB-Code (from SB-Help):
Code: Select all
Procedure HttpGetEvent(Success, Result$, UserData)
If Success
Debug Result$
Else
Debug "HTTPRequest(): Error"
EndIf
EndProcedure
; Get the content of this file, and display it in the debug window
HTTPRequest(#PB_HTTP_Get, "http://localhost/readfile/readfile.php", "", @HttpGetEvent())
Code: Select all
<?php
header('Access-Control-Allow-Origin: http://127.0.0.1:9080');
echo file_get_contents("test.txt");
?>
-
- Posts: 120
- Joined: Tue Jun 14, 2016 7:17 pm
Re: can i read local server file ?
thanks peter ^^