rejetto forum
Software => HFS ~ HTTP File Server => Topic started by: kabutzal on December 06, 2015, 04:24:34 PM
-
I need to have all files from HFS served with CORS (Access-Control-Allow-Origin header).
Unfortunately, I don't understand much about HFS macros and templates.
I tried implementing the solution given here with no luck:
http://www.rejetto.com/forum/html-templates/cors-header-and-simple-template-for-javascript-driven-access/
Can someone please explain in detail how to do this?
Thanks
-
okay, that one of mayny post redirefts
so yo have to have a javaspcipot, or some html / macor coding with HFS to send and receve dat via the headder....
so the post that you posted goes over covering a few issue (assuming you already have the JavaScript code to download and upload! (that was never shared int eh post!
what was shared was the issue / fix for that person:
http://www.rejetto.com/forum/html-templates/cors-header-and-simple-template-for-javascript-driven-access/msg1058937/#msg1058937
Add {.add header | Access-Control-Allow-Origin: * .} to template works for templates
which orginaly is not in HFS.... os it was added to HFS....
the post later went on to go to a template that had those requests " XMLHttpRequest(GET ... ). / XMLHttpRequest(PUT ...)
http://www.rejetto.com/forum/italiano/template-vista-con-chat-e-video-player-italiano-vers-1-8-new/?action=dlattach;attach=7846
which has how the code can work.....
Now that rases the question??? - what did you " I tried implementing" ?
What do you need help with?
what are you trying to do?...
-
I have a few files sitting in HFS's virtual file system.
When a browser tries to access/download these files, I need HFS to include the CORS headers in the response.
Here are the instructions for various server types:
http://enable-cors.org/server.html
HFS is not there.
Is this possible?
-
form the forum post and the link you have sent me, to my understanding, it is possible....
http://www.html5rocks.com/en/tutorials/cors/
You need to add this to hfs header!...
so right click properties "/" the house in HFS
Different template tab
add this line:
{.add header | Access-Control-Allow-Origin: * .}
derived form the other forum post adn your site:
http://enable-cors.org/server_php.html
http://enable-cors.org/server_perl.html
-
Thank you so much!
-
i would try events instead changing the template
Menu > other options > edit event scripts
then put this
[download]
{.add header | Access-Control-Allow-Origin: * .}
-
i would try events instead changing the template
Menu > other options > edit event scripts
then put this
[download]
{.add header | Access-Control-Allow-Origin: * .}
It does not work for me. Requests to save a text file .txt Where to save it?
-
form the forum post and the link you have sent me, to my understanding, it is possible....
http://www.html5rocks.com/en/tutorials/cors/
You need to add this to hfs header!...
so right click properties "/" the house in HFS
Different template tab
add this line:
{.add header | Access-Control-Allow-Origin: * .}
derived form the other forum post adn your site:
http://enable-cors.org/server_php.html
http://enable-cors.org/server_perl.html
Also the error repeats. Maybe because I take the file through the port and I need to specify the address of the type:
{.add header | Access-Control-Allow-Origin: site.com:port .}
?
-
i would try events instead changing the template
Menu > other options > edit event scripts
then put this
[download]
{.add header | Access-Control-Allow-Origin: * .}
More of a question for rejeto. (As I wouldn't know how to tell the full coros hand shake and see it. I'd wore shark the packet to see the header.
As long as you followed rejeto instructions this should.be working g on the stable build