Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #38902 > unrolled thread
| Started by | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| First post | 2020-10-07 08:23 -0700 |
| Last post | 2020-10-09 23:52 +0200 |
| Articles | 20 on this page of 24 — 7 participants |
Back to article view | Back to comp.lang.javascript
IIS http.open "GET" error Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-07 08:23 -0700
Re: IIS http.open "GET" error Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-07 08:34 -0700
Re: IIS http.open "GET" error Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-07 08:35 -0700
Re: IIS http.open "GET" error John G Harris <niam@jghnorth.org.uk.invalid> - 2020-10-07 18:01 +0100
Re: IIS http.open "GET" error Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-07 10:18 -0700
Re: IIS http.open "GET" error Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-07 11:51 -0700
Re: IIS http.open "GET" error Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-07 11:59 -0700
Re: IIS http.open "GET" error "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-10-07 21:14 +0200
Re: IIS http.open "GET" error Julio Di Egidio <julio@diegidio.name> - 2020-10-07 17:20 -0700
Re: IIS http.open "GET" error Julio Di Egidio <julio@diegidio.name> - 2020-10-07 17:30 -0700
Re: IIS http.open "GET" error Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-07 19:26 -0700
Re: IIS http.open "GET" error Frank Kozuschnik <franko@nurfuerspam.de> - 2020-10-08 10:38 +0200
Re: IIS http.open "GET" error Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-08 02:07 -0700
Re: IIS http.open "GET" error Julio Di Egidio <julio@diegidio.name> - 2020-10-08 05:49 -0700
Re: IIS http.open "GET" error "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-10-08 15:22 +0200
Re: IIS http.open "GET" error Julio Di Egidio <julio@diegidio.name> - 2020-10-08 06:30 -0700
Re: IIS http.open "GET" error Arno Welzel <usenet@arnowelzel.de> - 2020-10-09 12:03 +0200
Re: IIS http.open "GET" error Frank Kozuschnik <franko@nurfuerspam.de> - 2020-10-09 17:33 +0200
Re: IIS http.open "GET" error Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-10-09 18:14 +0200
Re: IIS http.open "GET" error Frank Kozuschnik <franko@nurfuerspam.de> - 2020-10-09 19:38 +0200
Re: IIS http.open "GET" error Julio Di Egidio <julio@diegidio.name> - 2020-10-11 03:30 -0700
Re: IIS http.open "GET" error Arno Welzel <usenet@arnowelzel.de> - 2020-10-09 23:49 +0200
Re: IIS http.open "GET" error Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-09 11:06 -0700
Re: IIS http.open "GET" error Arno Welzel <usenet@arnowelzel.de> - 2020-10-09 23:52 +0200
Page 1 of 2 [1] 2 Next page →
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2020-10-07 08:23 -0700 |
| Subject | IIS http.open "GET" error |
| Message-ID | <ebdc63ad-7565-4d6e-872e-90c9a8719f70o@googlegroups.com> |
Just installed IIS on the new computer, the SPASSKY.JCH game will donwload from external internet service provider site but i can not get it download from localhost 127.0.0.1 IIS server. "the webserver start" it is just the get of file that fail on my server.
Is it just a filepath error or something else?
The file resides at root level in IIS server.
function loadFile(filePath) {
var result = null;
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", filePath, false);
xmlhttp.send();
if (xmlhttp.status==200) {
result = xmlhttp.responseText;
}
return result;
}
function parse(myString){
moveNumber=0;
moveList.length=0;
moveText.length=0;
mode=="setup";
var myArr = myString.split("$");
document.getElementById("lgamedata").value=myArr[0];
document.getElementById("lgametext").value=myArr[1];
document.getElementById("lgameinfo").value=myArr[2];
lineArr=myArr[0].split("\n");
initTiles();
for (var i=0;i<lineArr.length-1;i++){
numbArr=lineArr[i].split(" ");
addToMoves(numbArr[0],numbArr[1]);
movePiece(numbArr[0],numbArr[1]);
}
}
textFromFileLoaded=loadFile('SPASSKY.JCH');
parse(textFromFileLoaded)
loadsave.js:62 Uncaught TypeError: Cannot read property 'split' of null
at parse (loadsave.js:62)
at chessInit (gameengine.js:14)
at (index):130
[toc] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2020-10-07 08:34 -0700 |
| Message-ID | <af49f07b-831f-45e0-bf7c-a8d3105282fdo@googlegroups.com> |
| In reply to | #38902 |
Den onsdag 7 oktober 2020 kl. 17:23:33 UTC+2 skrev Jonas Thörnvall:
> Just installed IIS on the new computer, the SPASSKY.JCH game will donwload from external internet service provider site but i can not get it download from localhost 127.0.0.1 IIS server. "the webserver start" it is just the get of file that fail on my server.
>
> Is it just a filepath error or something else?
> The file resides at root level in IIS server.
>
> function loadFile(filePath) {
> var result = null;
> var xmlhttp = new XMLHttpRequest();
> xmlhttp.open("GET", filePath, false);
> xmlhttp.send();
> if (xmlhttp.status==200) {
> result = xmlhttp.responseText;
> }
> return result;
> }
>
> function parse(myString){
> moveNumber=0;
> moveList.length=0;
> moveText.length=0;
> mode=="setup";
> var myArr = myString.split("$");
> document.getElementById("lgamedata").value=myArr[0];
> document.getElementById("lgametext").value=myArr[1];
> document.getElementById("lgameinfo").value=myArr[2];
> lineArr=myArr[0].split("\n");
> initTiles();
> for (var i=0;i<lineArr.length-1;i++){
> numbArr=lineArr[i].split(" ");
> addToMoves(numbArr[0],numbArr[1]);
> movePiece(numbArr[0],numbArr[1]);
> }
> }
>
> textFromFileLoaded=loadFile('SPASSKY.JCH');
> parse(textFromFileLoaded)
>
> loadsave.js:62 Uncaught TypeError: Cannot read property 'split' of null
> at parse (loadsave.js:62)
> at chessInit (gameengine.js:14)
> at (index):130
???
loadsave.js:47 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2020-10-07 08:35 -0700 |
| Message-ID | <86276b2c-8ff1-4574-8376-7650e7f6f8e0o@googlegroups.com> |
| In reply to | #38903 |
Den onsdag 7 oktober 2020 kl. 17:34:22 UTC+2 skrev Jonas Thörnvall:
> Den onsdag 7 oktober 2020 kl. 17:23:33 UTC+2 skrev Jonas Thörnvall:
> > Just installed IIS on the new computer, the SPASSKY.JCH game will donwload from external internet service provider site but i can not get it download from localhost 127.0.0.1 IIS server. "the webserver start" it is just the get of file that fail on my server.
> >
> > Is it just a filepath error or something else?
> > The file resides at root level in IIS server.
> >
> > function loadFile(filePath) {
> > var result = null;
> > var xmlhttp = new XMLHttpRequest();
> > xmlhttp.open("GET", filePath, false);
> > xmlhttp.send();
> > if (xmlhttp.status==200) {
> > result = xmlhttp.responseText;
> > }
> > return result;
> > }
> >
> > function parse(myString){
> > moveNumber=0;
> > moveList.length=0;
> > moveText.length=0;
> > mode=="setup";
> > var myArr = myString.split("$");
> > document.getElementById("lgamedata").value=myArr[0];
> > document.getElementById("lgametext").value=myArr[1];
> > document.getElementById("lgameinfo").value=myArr[2];
> > lineArr=myArr[0].split("\n");
> > initTiles();
> > for (var i=0;i<lineArr.length-1;i++){
> > numbArr=lineArr[i].split(" ");
> > addToMoves(numbArr[0],numbArr[1]);
> > movePiece(numbArr[0],numbArr[1]);
> > }
> > }
> >
> > textFromFileLoaded=loadFile('SPASSKY.JCH');
> > parse(textFromFileLoaded)
> >
> > loadsave.js:62 Uncaught TypeError: Cannot read property 'split' of null
> > at parse (loadsave.js:62)
> > at chessInit (gameengine.js:14)
> > at (index):130
> ???
> loadsave.js:47 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
xmlhttp.open("GET", filePath, false);
[toc] | [prev] | [next] | [standalone]
| From | John G Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2020-10-07 18:01 +0100 |
| Message-ID | <p2trnf1q8dark9985775iot7rk74jc59ih@4ax.com> |
| In reply to | #38902 |
On Wed, 7 Oct 2020 08:23:24 -0700 (PDT), Jonas Thörnvall
<jonas.thornvall@gmail.com> wrote:
<snip>
>textFromFileLoaded=loadFile('SPASSKY.JCH');
<snip>
Have you tried
'/SPASSKY.JCH'
John
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2020-10-07 10:18 -0700 |
| Message-ID | <70aa8941-dbc7-4277-a7f2-a2f1cbd63ab2o@googlegroups.com> |
| In reply to | #38905 |
Den onsdag 7 oktober 2020 kl. 19:01:29 UTC+2 skrev John G Harris:
> On Wed, 7 Oct 2020 08:23:24 -0700 (PDT), Jonas Thörnvall
> <jonas.thornvall@gmail.com> wrote:
>
> <snip>
> >textFromFileLoaded=loadFile('SPASSKY.JCH');
> <snip>
>
> Have you tried
>
> '/SPASSKY.JCH'
>
> John
Yes i have, i do not think it is the path anymore. Apparently IIS server can't see anyfile beyond the index.html if you write out filename you get not found.
I think it may be something about allowing dynamic content on the ISS, kind of strange have no memory i did need to do it on the other machine that no longer in use/work.
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2020-10-07 11:51 -0700 |
| Message-ID | <b45e9346-f223-407f-828e-37cfc19415f7o@googlegroups.com> |
| In reply to | #38906 |
Den onsdag 7 oktober 2020 kl. 19:18:12 UTC+2 skrev Jonas Thörnvall:
> Den onsdag 7 oktober 2020 kl. 19:01:29 UTC+2 skrev John G Harris:
> > On Wed, 7 Oct 2020 08:23:24 -0700 (PDT), Jonas Thörnvall
> > <jonas.thornvall@gmail.com> wrote:
> >
> > <snip>
> > >textFromFileLoaded=loadFile('SPASSKY.JCH');
> > <snip>
> >
> > Have you tried
> >
> > '/SPASSKY.JCH'
> >
> > John
>
> Yes i have, i do not think it is the path anymore. Apparently IIS server can't see anyfile beyond the index.html if you write out filename you get not found.
>
> I think it may be something about allowing dynamic content on the ISS, kind of strange have no memory i did need to do it on the other machine that no longer in use/work.
I installed some ISAPI CGI restriction module now it download/list the JS files at least. But still not found 404 for the JCH extension.
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2020-10-07 11:59 -0700 |
| Message-ID | <1b936f13-60b8-4c71-8e9c-cf3f55ac95aeo@googlegroups.com> |
| In reply to | #38907 |
Den onsdag 7 oktober 2020 kl. 20:51:35 UTC+2 skrev Jonas Thörnvall:
> Den onsdag 7 oktober 2020 kl. 19:18:12 UTC+2 skrev Jonas Thörnvall:
> > Den onsdag 7 oktober 2020 kl. 19:01:29 UTC+2 skrev John G Harris:
> > > On Wed, 7 Oct 2020 08:23:24 -0700 (PDT), Jonas Thörnvall
> > > <jonas.thornvall@gmail.com> wrote:
> > >
> > > <snip>
> > > >textFromFileLoaded=loadFile('SPASSKY.JCH');
> > > <snip>
> > >
> > > Have you tried
> > >
> > > '/SPASSKY.JCH'
> > >
> > > John
> >
> > Yes i have, i do not think it is the path anymore. Apparently IIS server can't see anyfile beyond the index.html if you write out filename you get not found.
> >
> > I think it may be something about allowing dynamic content on the ISS, kind of strange have no memory i did need to do it on the other machine that no longer in use/work.
>
> I installed some ISAPI CGI restriction module now it download/list the JS files at least. But still not found 404 for the JCH extension.
Well i changed the extension to TXT and it now works, do anyone know where to set the allowed extensions to download in IIS?
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2020-10-07 21:14 +0200 |
| Message-ID | <XnsAC4FD801DB31Ceejj99@194.109.6.166> |
| In reply to | #38908 |
=?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 07 Oct 2020 in comp.lang.javascript: > Well i changed the extension to TXT and it now works, do anyone know > where to set the allowed extensions to download in IIS? You can set the accessable extensions in ISS, and smome of them have a special meaning in the sense that the file is feverted to an engine, and the output of the engine is sent to the user. Exampes: .asp and .aspx and sometimes .php -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Julio Di Egidio <julio@diegidio.name> |
|---|---|
| Date | 2020-10-07 17:20 -0700 |
| Message-ID | <5a99baa7-f3dc-4cc7-9551-5a413e1e3105o@googlegroups.com> |
| In reply to | #38908 |
On Wednesday, 7 October 2020 20:59:48 UTC+2, Jonas Thörnvall wrote: > Well i changed the extension to TXT and it now works, do anyone > know where to set the allowed extensions to download in IIS? Yes. Julio
[toc] | [prev] | [next] | [standalone]
| From | Julio Di Egidio <julio@diegidio.name> |
|---|---|
| Date | 2020-10-07 17:30 -0700 |
| Message-ID | <eaa2a875-94c9-4f97-9f30-21b2cc1ab4c8o@googlegroups.com> |
| In reply to | #38910 |
On Thursday, 8 October 2020 02:20:53 UTC+2, Julio Di Egidio wrote: > On Wednesday, 7 October 2020 20:59:48 UTC+2, Jonas Thörnvall wrote: > > > Well i changed the extension to TXT and it now works, do anyone > > know where to set the allowed extensions to download in IIS? > > Yes. <https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap#how-to> (Don't look at the sample code, just follow the how-to section...) HTH, Julio
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2020-10-07 19:26 -0700 |
| Message-ID | <f46d3d9f-8eac-4974-9b61-20be4ec2c31do@googlegroups.com> |
| In reply to | #38911 |
Den torsdag 8 oktober 2020 kl. 02:30:35 UTC+2 skrev Julio Di Egidio: > On Thursday, 8 October 2020 02:20:53 UTC+2, Julio Di Egidio wrote: > > On Wednesday, 7 October 2020 20:59:48 UTC+2, Jonas Thörnvall wrote: > > > > > Well i changed the extension to TXT and it now works, do anyone > > > know where to set the allowed extensions to download in IIS? > > > > Yes. > > <https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap#how-to> > > (Don't look at the sample code, just follow the how-to section...) > > HTH, > > Julio Thanks Julio, unfortunately it must be something more then set the mimetype to plain/text to allow the extension for HTTP GET in IIS server. It is no problem for me to use TXT as extension for the chessgame autoloaded, but i was just curious howto allow my new extension to be downloaded from server.
[toc] | [prev] | [next] | [standalone]
| From | Frank Kozuschnik <franko@nurfuerspam.de> |
|---|---|
| Date | 2020-10-08 10:38 +0200 |
| Message-ID | <rlmj59$45u$1@solani.org> |
| In reply to | #38912 |
Jonas Thörnvall:
> Julio Di Egidio:
>
>>> Jonas Thörnvall:
>>>
>>>> Well i changed the extension to TXT and it now works, do anyone
>>>> know where to set the allowed extensions to download in IIS?
>>
>> <https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap#how-to>
>>
>> (Don't look at the sample code, just follow the how-to section...)
>
> Thanks Julio, unfortunately it must be something more then set the
> mimetype to plain/text to allow the extension for HTTP GET in IIS
> server. It is no problem for me to use TXT as extension for the
> chessgame autoloaded, but i was just curious howto allow my new
> extension to be downloaded from server.
Did you try Julio's suggestion?
If the file name suffix ("extension") does not exist in the "MIME Types"
list, IIS does not serve the file to clients and will return a HTTP 404
error instead. To make IIS serve the file, you have to add its suffix to
the "MIME Types" list (<mimeMap> element in the configuration file). The
actual MIME type that you enter does not matter for the purpose of
allowing the download (it will be returned in the HTTP Content-Type header).
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2020-10-08 02:07 -0700 |
| Message-ID | <6b8b3e82-95ae-4e2e-9859-3bc202f8d93eo@googlegroups.com> |
| In reply to | #38913 |
Den torsdag 8 oktober 2020 kl. 10:38:10 UTC+2 skrev Frank Kozuschnik:
> Jonas Thörnvall:
>
> > Julio Di Egidio:
> >
> >>> Jonas Thörnvall:
> >>>
> >>>> Well i changed the extension to TXT and it now works, do anyone
> >>>> know where to set the allowed extensions to download in IIS?
> >>
> >> <https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap#how-to>
> >>
> >> (Don't look at the sample code, just follow the how-to section...)
> >
> > Thanks Julio, unfortunately it must be something more then set the
> > mimetype to plain/text to allow the extension for HTTP GET in IIS
> > server. It is no problem for me to use TXT as extension for the
> > chessgame autoloaded, but i was just curious howto allow my new
> > extension to be downloaded from server.
>
> Did you try Julio's suggestion?
>
> If the file name suffix ("extension") does not exist in the "MIME Types"
> list, IIS does not serve the file to clients and will return a HTTP 404
> error instead. To make IIS serve the file, you have to add its suffix to
> the "MIME Types" list (<mimeMap> element in the configuration file). The
> actual MIME type that you enter does not matter for the purpose of
> allowing the download (it will be returned in the HTTP Content-Type header).
Yes i did register it as plain/text.
[toc] | [prev] | [next] | [standalone]
| From | Julio Di Egidio <julio@diegidio.name> |
|---|---|
| Date | 2020-10-08 05:49 -0700 |
| Message-ID | <446322ac-b1bb-4a81-813e-a20b9be2a4e4o@googlegroups.com> |
| In reply to | #38912 |
On Thursday, 8 October 2020 04:27:07 UTC+2, Jonas Thörnvall wrote: > Den torsdag 8 oktober 2020 kl. 02:30:35 UTC+2 skrev Julio Di Egidio: > > On Thursday, 8 October 2020 02:20:53 UTC+2, Julio Di Egidio wrote: > > > On Wednesday, 7 October 2020 20:59:48 UTC+2, Jonas Thörnvall wrote: > > > > > > > Well i changed the extension to TXT and it now works, do anyone > > > > know where to set the allowed extensions to download in IIS? > > > > > > Yes. > > > > <https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap#how-to> > > > > (Don't look at the sample code, just follow the how-to section...) > > Thanks Julio, unfortunately it must be something more then set the > mimetype to plain/text to allow the extension for HTTP GET in IIS > server. Forgot to mention that you'll need to restart the web site in question in order for the new config to be picked up: stop the site then start it again from the IIS admin. If that's too difficult (or not enough, it really depends on the details of your setup), just reboot the computer. > It is no problem for me to use TXT as extension Assuming you have tried to just change the extension of the file, not used other files, then the above must work or it's you messing up (for example "plain/text"??!). Notice that it is actually important to use at least a mime type such that the web server serves the file as text, not binary (in this case), but also a mime type that the browser understands: so do go for "text/plain". HTH, Julio
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2020-10-08 15:22 +0200 |
| Message-ID | <XnsAC509C56C4719eejj99@194.109.6.166> |
| In reply to | #38915 |
Julio Di Egidio <julio@diegidio.name> wrote on 08 Oct 2020 in comp.lang.javascript: > On Thursday, 8 October 2020 04:27:07 UTC+2, Jonas Thörnvall wrote: >> Den torsdag 8 oktober 2020 kl. 02:30:35 UTC+2 skrev Julio Di Egidio: >> > On Thursday, 8 October 2020 02:20:53 UTC+2, Julio Di Egidio wrote: >> > > On Wednesday, 7 October 2020 20:59:48 UTC+2, Jonas Thörnvall wr > ote: >> > > >> > > > Well i changed the extension to TXT and it now works, do anyone >> > > > know where to set the allowed extensions to download in IIS? >> > > >> > > Yes. >> > >> > <https://docs.microsoft.com/en-us/iis/configuration/system.webserver/st > aticcontent/mimemap#how-to> >> > >> > (Don't look at the sample code, just follow the how-to section...) >> >> Thanks Julio, unfortunately it must be something more then set the >> mimetype to plain/text to allow the extension for HTTP GET in IIS >> server. > > Forgot to mention that you'll need to restart the web site in > question in order for the new config to be picked up: stop the > site then start it again from the IIS admin. If that's too > difficult (or not enough, it really depends on the details of > your setup), just reboot the computer. > >> It is no problem for me to use TXT as extension > > Assuming you have tried to just change the extension of the > file, not used other files, then the above must work or it's > you messing up (for example "plain/text"??!). > > Notice that it is actually important to use at least a mime > type such that the web server serves the file as text, not > binary (in this case), but also a mime type that the browser > understands: so do go for "text/plain". The mine type nees to be "text/html". <https://www.trivantis.com/help/CourseMill/7.4/en/Troubleshooting/Content/Tr oubleshooting_mime.html> -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Julio Di Egidio <julio@diegidio.name> |
|---|---|
| Date | 2020-10-08 06:30 -0700 |
| Message-ID | <1a58db5c-384c-4f01-a79f-5b885faeb0a3o@googlegroups.com> |
| In reply to | #38916 |
On Thursday, 8 October 2020 15:22:50 UTC+2, Evertjan. wrote: > Julio Di Egidio <julio@diegidio.name> wrote on 08 Oct 2020 in > comp.lang.javascript: > > On Thursday, 8 October 2020 04:27:07 UTC+2, Jonas Thörnvall wrote: > >> Den torsdag 8 oktober 2020 kl. 02:30:35 UTC+2 skrev Julio Di Egidio: > >> > On Thursday, 8 October 2020 02:20:53 UTC+2, Julio Di Egidio wrote: > >> > > On Wednesday, 7 October 2020 20:59:48 UTC+2, Jonas Thörnvall wr > > ote: > >> > > > >> > > > Well i changed the extension to TXT and it now works, do anyone > >> > > > know where to set the allowed extensions to download in IIS? > >> > > > >> > > Yes. > >> > > >> > <https://docs.microsoft.com/en-us/iis/configuration/system.webserver/st > > aticcontent/mimemap#how-to> > >> > > >> > (Don't look at the sample code, just follow the how-to section...) > >> > >> Thanks Julio, unfortunately it must be something more then set the > >> mimetype to plain/text to allow the extension for HTTP GET in IIS > >> server. > > > > Forgot to mention that you'll need to restart the web site in > > question in order for the new config to be picked up: stop the > > site then start it again from the IIS admin. If that's too > > difficult (or not enough, it really depends on the details of > > your setup), just reboot the computer. > > > >> It is no problem for me to use TXT as extension > > > > Assuming you have tried to just change the extension of the > > file, not used other files, then the above must work or it's > > you messing up (for example "plain/text"??!). > > > > Notice that it is actually important to use at least a mime > > type such that the web server serves the file as text, not > > binary (in this case), but also a mime type that the browser > > understands [so you can open the file directly, i.e. from the > > address bar of the browser]: so do go for "text/plain". > > The mine type nees to be "text/html". > <https://www.trivantis.com/help/CourseMill/7.4/en/Troubleshooting/Content/Tr > oubleshooting_mime.html> You are a fucking disgrace. *Troll alert* Julio
[toc] | [prev] | [next] | [standalone]
| From | Arno Welzel <usenet@arnowelzel.de> |
|---|---|
| Date | 2020-10-09 12:03 +0200 |
| Message-ID | <huaqreFqk7fU1@mid.individual.net> |
| In reply to | #38902 |
Jonas Thörnvall:
> Just installed IIS on the new computer, the SPASSKY.JCH game will
> donwload from external internet service provider site but i can not
> get it download from localhost 127.0.0.1 IIS server. "the webserver
> start" it is just the get of file that fail on my server.
>
> Is it just a filepath error or something else? The file resides at
> root level in IIS server.
>
> function loadFile(filePath) { var result = null; var xmlhttp = new
> XMLHttpRequest(); xmlhttp.open("GET", filePath, false);
> xmlhttp.send(); if (xmlhttp.status==200) { result =
> xmlhttp.responseText; } return result; }
[...]
> textFromFileLoaded=loadFile('SPASSKY.JCH');
> parse(textFromFileLoaded)
>
> loadsave.js:62 Uncaught TypeError: Cannot read property 'split' of
> null at parse (loadsave.js:62) at chessInit (gameengine.js:14) at
> (index):130
1) Make sure IIS works at all - put the file named SPASSKY.JCH to the
root directory and check that http://localhost/SPASSKY.JCH or
http://127.0.0.1/SPASSKY.JCH gives you the content of that file.
2) XHR does not load "files" it will send a HTTP request for an *URL*.
Also see
<https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/open>.
Therefore you should also put the URL there and not just a file name.
3) Add error handling - there are many reasons why a request can fail.
Assuming a function which fetches data via XHR will always work and
always return data in a certain way will eventually cause security
problems. If loadFile() can return null then handle this case and don't
assume in parse() that there will always be a valid content.
--
Arno Welzel
https://arnowelzel.de
[toc] | [prev] | [next] | [standalone]
| From | Frank Kozuschnik <franko@nurfuerspam.de> |
|---|---|
| Date | 2020-10-09 17:33 +0200 |
| Message-ID | <rlpvrv$h67$1@solani.org> |
| In reply to | #38918 |
Arno Welzel:
> 1) Make sure IIS works at all - put the file named SPASSKY.JCH to the
> root directory and check that http://localhost/SPASSKY.JCH or
> http://127.0.0.1/SPASSKY.JCH gives you the content of that file.
In a default setup, IIS will return a HTTP 404 error because the '.JCH'
suffix ("extension") is unknown. Adding the suffix to the "MIME Types"
list of the IIS configuration may help.
> 2) XHR does not load "files" it will send a HTTP request for an *URL*.
> Also see
> <https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/open>.
> Therefore you should also put the URL there and not just a file name.
"Just a file name" *is* a valid URL, typically relative to the URL of
the current document. See RFC 1808 for details.
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2020-10-09 18:14 +0200 |
| Message-ID | <11639806.O9o76ZdvQC@PointedEars.de> |
| In reply to | #38919 |
Frank Kozuschnik wrote: > Arno Welzel: >> 2) XHR does not load "files" it will send a HTTP request for an *URL*. >> Also see >> <https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/open>. >> Therefore you should also put the URL there and not just a file name. > > "Just a file name" *is* a valid URL, typically relative to the URL of > the current document. In proper technical terms, it is a URI-reference. It is NOT a URL. > See RFC 1808 for details. That RFC (from 1995) was updated by RFC 2396 in 1998, which was obsoleted by RFC 3986 in 2005, which was updated by RFC 6874 in 2013, by RFC 7320 in 2014 (obsoleted by RFC 8820 in 2020), and by RFC 8820 in 2020. So what you are citing has always been irrelevant to the question before as XMLHttpRequest was initially developed for Outlook Web Access in 2000. When looking up RFCs, I strongly recommend to use the URI https://tools.ietf.org/html/ which provides the text of an RFC, and information about RFCs that obsolete and update it, which are linked. -- PointedEars FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix> <https://github.com/PointedEars> | <http://PointedEars.de/wsvn/> Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
[toc] | [prev] | [next] | [standalone]
| From | Frank Kozuschnik <franko@nurfuerspam.de> |
|---|---|
| Date | 2020-10-09 19:38 +0200 |
| Message-ID | <rlq76k$ncl$1@solani.org> |
| In reply to | #38920 |
Thomas 'PointedEars' Lahn: > Frank Kozuschnik: > >> "Just a file name" *is* a valid URL, typically relative to the URL of >> the current document. > > In proper technical terms, it is a URI-reference. It is NOT a URL. My apologies for picking the outdated reference. RFC 1808 has indeed become history, and the current RFC no longer uses the term "relative URL". The WHATWG specification calls it a valid URL string. As such, it is still a valid argument for the open() method.
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | comp.lang.javascript
csiph-web