FTP via XHR to same domain, how?

161 views
Skip to first unread message

André Fiedler

unread,
Feb 25, 2011, 2:22:15 PM2/25/11
to mootool...@googlegroups.com
Hi folks, hope you are well? :o)

It´s not really a mootools related question, but i hope there are a lot of experts here.

This page mentiones, I can do a FTP requests to my own server:
https://developer.mozilla.org/en/using_xmlhttprequest

so I tried this using Google Chrome 10:

req.open('LIST', 'ftp://user123:pas...@mydomain.net/', true);
req.onreadystatechange = handler;
req.send();

but i get this exception:

XMLHttpRequest cannot load ftp://mydomain.net/. Origin http://www.mydomain.net is not allowed by Access-Control-Allow-Origin.

Did someone try this? I want to exec some simple FTP commands (list,get,put) on the same domain.

greetings André

Matthew Hazlett

unread,
Feb 25, 2011, 3:11:36 PM2/25/11
to mootool...@googlegroups.com

Not sure but just a guess, you might need the access control list in your root to authorize this.

 

http://www.w3.org/TR/cors/

Matthew Hazlett

unread,
Feb 25, 2011, 3:12:45 PM2/25/11
to mootool...@googlegroups.com

 

From: mootool...@googlegroups.com [mailto:mootool...@googlegroups.com] On Behalf Of André Fiedler
Sent: Friday, February 25, 2011 2:22 PM
To: mootool...@googlegroups.com
Subject: [Moo] FTP via XHR to same domain, how?

 

Hi folks, hope you are well? :o)

Andrew Sutherland

unread,
Feb 25, 2011, 4:19:38 PM2/25/11
to mootool...@googlegroups.com
well you've obfuscated the domain, but it sort of looks like you might be trying to make a request from www.mydomain.net to mydomain.net. I know you cant make xhr requests from http to https on the same domain, but you might be able to get it working from ftp. They note in the URL you posted that the status codes don't work the same way on FTP that they do on HTTP. I'm not looking at the mootools source right now but even if you did get it working, your data might not come through onSuccess because success looks for 2xx http codes. It might be in onFailure

-Andrew
Reply all
Reply to author
Forward
0 new messages