Differences between flash and web browser loading remote swf - browser

I am working on a project where I need to load a remote swf file into another using flash and as2. This should be simple, but the remote swf file is modular by design (i.e it needs to make calls to load other swf files into it)
When I enter in the location to the remote swf file from a web browser it has no problem loading up.
When I try and load the swf file using flash I get errors relating to the file system. It seems the flash being loaded into my flash is trying to load its other pieces and is looking for them on my computer.
notice the relative ../common/interface_engine.swf reference
*** Security Sandbox Violation ***
Connection to ../common/interface_engine.swf halted - not permitted from http://www.remote-domain.com
-- Remote SWFs may not access local files.
How come a web browser does not have any issue loading swf's like this? I don't get the difference in loading techniques that flash uses and a web browser uses.
Code that I use to load remote file
_root.createEmptyMovieClip("container", 1);
loadMovie(gamePath, "container");

For security reasons, Flash doesn't allow files running locally to have access to both local resources and remote resources. You can have one or the other. When the swf you're loading is referring to "../common/blah", it's relative to where it's being loaded.
Here's a much more in depth article about Flash security:
http://www.senocular.com/flash/tutorials/contentdomains/

Related

Need help in developing a custom WebDav client using node.js

I am developing an open source application which should mount webdav share to local drive letter just like NETDRIVE and WEBDRIVE using node.js and electron-js, so in my application at present I am downloading all files from webdav share which takes a lot of time and not reliable for heavy data. Is there any other approach so that whenever user access a file, only that particular file should be fetched from webdav share, I’ve tried to display files meta data(dummy) structure in directory and kept that directory under file-watcher. So that when user tries to open a file then watcher should capture file open event to get which file was user trying to access, so that in background of application a service will triggered to fetch that particular file using file-path as reference, but none of them are unable to capture file open event. Is there any other approach to do so, correct me if I am in wrong direction.
Thank's
I think you want virtual file-system and recommend Dokan library.
Dokan is the start point of Windows virtual file-system application.
Open Source : Dokan (https://en.wikipedia.org/wiki/Dokan_Library)
Commercial: EldoS CBFS (https://www.eldos.com/cbfs)
Google, Naver use Dokan and NetDrive, RaiDrive(mine) use CBFS.

Possible to set local folder for automatic file uploads

Bit of a loose question so if it gets marked down I'll remove it.. but..
I'm using Primefaces/Spring/Hibernate for Java server.
My application knows a load of file names I need to upload. Those files are on my local computer. Is it possible to tell the application the root directory of these files, for it to then setup uploads for each of these files without me needing to browse for each file individually?
I assume this is a browser security issue, i.e. the user needs to explicitly state which file the application is allowed to know about etc?
If not I'll have to do it in a local application but I was hoping there was a way a mass upload could be kicked off from the browser by just setting the local directory of the files.
I decided to use the Primefaces uploader, upload all the files in the directory and let the application sort them out once it has them on the server.

Flash Actionscript : Flash swf not loading from global servers

I have written a simple program in actionscript that displays a line.
Here is the AS code
import flash.display.Graphics;
var g:Graphics=graphics;
g.lineStyle(1,0,100);
g.lineTo(100,100);
I published this code in flash CS5 and received corresponding SWF and HTML file.
When I upload these files to a local server then the swf file is loaded properly and the line is displayed.
But when I uploaded it to any of the global servers like goDaddy the flash stopped working. Nothing was displayed on the screen.
On right clicking the flash panel it showed a message "movie not loaded".
And the strange fact is that its not happening on all systems. On some computers this flash is working fine.
Any idea what could be the reason?
Are you using the exact file name in your invoking HTML even for lowercases an uppercases? In Windows and Macintosh desktop computers or Windows Servers these differences are not important, but on linux servers, files like MYFILE.SWF are not the same than myfile.swf or MyFile.swf

MODX Revo - Unable to upload or view files in File section in Manager

I'm having problems uploading and even viewing files in the File section of MODX Revolution 2.2.3-pl. When I try to upload a file, all I get is "Upload error". Nothing shows up in the Filesystem area, just a folder called Media that doesn't let me do anything. Any ideas of what might be going on?
As far as file system permissions go, all folders are set to 755 and all files are set to 644. I'm seeing this behavior logged in as admin/sudo. I just moved my installation of MODX from my local machine, where I believe it worked right, to a shared hosting environment, and that's where I'm seeing this issue.
There has been a recent update to 2.2.4-pl after reported problems with the file manager.
I'd recommend updating to 2.2.4-pl and check if the problem is still present.
Also it could be that your MOD system settings have Use Multibyte Extension enabled but PHP hasn’t been compiled with the –enable-mbstring option.
Hidden away in the MODx Media Browser is a failed response to a JSON request and an error message showing…
Fatal error: Call to undefined function mb_strtolower() in on line 168
If you can’t recompile PHP or just need to get your Media Browser working again, go to System Settings and set Multibyte Extension to No.
All the credit to [Max Mitchell's Post].1

How to deploy a data file on tomcat web server in linux debian OS

I have a web application developed using JSP and Servlet. This web application is deployed on server having Debian Linux as OS and The Tomcat version is 5.5.31. As this applications required some data files, These data files will be get created automatically when setting are done using a standalone java application. This application is deployed on another machine. This setup is done. As I dont know much about Debian Linux and where my application is goes on it so I have some doubts in deployment of these autimatically generated data files which are as follows
As I made the .war file of my web application and deployed it using Tomcat Manager. so I dont know where exactly my application goes. I dont know the exact path. How do I find it?
Is it possible to create FTP for this web application which is deployed on Debian Linux server? I think that if creating FTP is possible then I will directly connect to FTP using my Stand alone Java program and will easily do the creation of the file and other file and directory manipulation.
If you've deployed a war, the application isn't anywhere on the filesystem as such. Most servers will unpack the war somewhere, but you shouldn’t rely on where that is.
I can think of several options:
getServletContext().getAttribute("javax.servlet.context.tempdir") to get the application's temp directory, then inform you external program of this location and place the file somewhere in there in a know location.
Arrange for a "know location" outside of the application, such as /tmp/somewhere or /var/cache/your-app/somewhere to place such files. (Note: /tmp is usually cleaned on startup of a linux machine)
As for getting the file onto the server from a remote machine: You could get your client to upload the file directly to your webapp (something like Apache HTTPClient will help you there), which means that you could do without the "know location" above. If you want to do this outside of the application though, I'd avoid FTP (due to security). Instead, I'd go with scp (secure copy).
Edit: Reading between the lines a little, you mention "setting" in the data file. If this is a configuration file which is not changed once the app is running, you may find it more convenient to have a "deploy" step on your server which simply takes the settings file and adds it to the war before deploying it. This is easy enough with "ant war" for example. You could then access the file using getClass().getResourceStream(..) or such.

Resources