Copy link to clipboard
Copied
This is the code I'm trying to use to detect if a file is on my flash server. The file is a recorded stream from a users webcam. What I am trying to do is create a pause to prevent the user from leaving the page until the file has completed the process of uploading and being encoded.
The code:
import flash.net.URLLoader
var urlRequest:URLRequest = new URLRequest("rmtp/xxx.xxx.xxx/direct/file.name");
var urlLoader:URLLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
urlLoader.addEventListener(Event.COMPLETE, urlLoader_complete);
urlLoader.addEventListener(IOErrorEvent.IO_ERROR, urlLoader_error);
urlLoader.load(urlRequest);
function urlLoader_complete(evt:Event):void {
trace("file found");
}
function urlLoader_error(evt:IOErrorEvent):void {
trace("file obviously not found");
}
The code works fine if the server is installed in the site public directory, I change rtmp to http and so on, but not when installed in the root. I'd prefer not to change from the root for security and logistic reasons. Any help or code suggestions would be appreciated as I've think I've exausted my google options.
Copy link to clipboard
Copied
If I´m understanding you right, the problem is you want to write to a directory (called root) where the normal user should not have complete read/write capability. If you are an admin of this server you could probably override this setting, otherwise its is not posssible with flash alone.
Copy link to clipboard
Copied
Sort of. The flash server is installed at home/flash and the home page is at home/httpdocs. The webcam feed from the user goes to a subdirectory in the flash directory. It's available through the rtmp access for viewing but when I use the above code it cannot detect the file. This is my own hosted server so it has a master IP and then a few additional IP's I've assigned to the sites on it. I've even tried using the master IP and the path to the file. The directory the file is put into and the files themself all have full read write permissions.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now