in Education by
Sorry for the subject line sounding like an even nerdier Harry Potter title. I'm trying to use AS3's Socket class to write a simple FTP program to export as an AIR app in Flex Builder 3. I'm using an FTP server on my local network to test the program. I can successfully connect to the server (the easy part) but I can't send any commands. I'm pretty sure that you have to use the ByteArray class to send these commands but there's some crucial piece of information that I'm missing apparently. Does anyone know how to do this? Thanks! Dave JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
The FTP protocol predates UTF encoding. Switch to ANSI/ASCII for better results. If you do opt for writeMultiByte instead of writeUTFBytes, be aware that it is buggy in linux. Here's one way around it. There's another question here where the line ending turns out to be the culprit, so make sure that you get it right (as suggested above). As said before, if this is running from the web, all socket connections will require a crossdomain policy, but this is NOT file based over HTTP. Recent changes to the security rules mean that any socket based connection must first get a crossdomain from a policy server hosted on port 843 of the target host. Quoting from Adobe: A SWF file may no longer make a socket connection to its own domain without a socket policy file. Prior to version 9,0,115,0, a SWF file was permitted to make socket connections to ports 1024 or greater in its own domain without a policy file. HTTP policy files may no longer be used to authorize socket connections. Prior to version 9,0,115,0, an HTTP policy file, served from the master location of /crossdomain.xml on port 80, could be used to authorize a socket connection to any port 1024 or greater on the same host. Essentially, what this means is that you must be in control of the target FTP host, and install supplementary software on it to get this working.

Related questions

0 votes
    I have a project i need to update form AS2 to AS3 as i need some of the new functions available ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 16, 2022 in Education by JackTerrance
0 votes
    I am creating a script on the fly to ftp some files from a remote computer. I create a file ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I am creating a script on the fly to ftp some files from a remote computer. I create a file ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I am trying to retrieve a particular file from multiple FTP servers. those server details are stored in ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
0 votes
    My camel route tries to pick up some files from sftp, transfer them to network, and delete them from ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    Using classic templates, publishing via FTP to a custom domain. I want to add custom elements such as: ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    What login credentials do I use to connect to the FTP site that is listed on the dashboard of my Azure? I ... this is failing. TIA. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    FTP is an acronym for- (a) File Transaction Protocol (b) File Truncation Protocol (c) File Translation ... File Transmission Protocol Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
0 votes
    Which of the following is the port number for FTP data? (a) 20 (b) 21 (c) 22 (d) 23 The question was ... bank, Cyber Security questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 4, 2021 in Education by JackTerrance
0 votes
    Which of the following is the port number for FTP control? (a) 20 (b) 21 (c) 22 (d) 23 The question ... bank, Cyber Security questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 4, 2021 in Education by JackTerrance
0 votes
0 votes
    To import a file from FTP, which of the following are the mandatory components? tFTPConnection, ... , tFTPGet tFTPConnection, tFTPGet tFTPConnection, tFTPExists, tFTPGet...
asked Mar 24, 2021 in Technology by JackTerrance
0 votes
    I have troubles with socket connection of PC (simple server written on Java) and android emulator. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I have troubles with socket connection of PC (simple server written on Java) and android emulator. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
...