How to Browse Server files using Flex4 - actionscript-3

I need to show the server uploaded files in flex 4.5 for a web application to manage the uploaded files like upload, delete and open for preview.
Can anyone help me How to list the sever side files in Flex action script3.0?

You can't just let Flash player browse your server files. But you could create a workaround.
Make a script on the server which will give you the list of files located at the path you're looking for. Through basic POST you can ask for a list of files for a directory. Then you can display it in your flash side. But remember every actual action that happens to your files MUST happen on the serverside. Also BEWARE such things, because it's really easy to look up network requests that are made in browser, so you may end up with all of your files deleted one day. So make sure you implement some security stuff.

Related

How to disable parent directory access in web file browsing without web server

I am writing a command line application that produces an index.html with links to other generated HTML files, but also some links to filesystem subdirectories. Here is an example of such a link:
Invoices
The intention for sharing this content is for the user to zip up the directory tree and send it to other parties for review. However, some users might think to use ngrok, or use screen sharing, to share their web browser to allow other people to access their local system. With ngrok they would be running a web server and might be able to configure the web server to protect against this, but with screen sharing that would not be possible. (Consider the case where a user might leave their web browser open to the remote user and step away, not realizing that the remote user can now examine their entire filesystem.)
The problem is the "Parent Directory" links. Using those links, the others could navigate above the intended directory root and navigate their entire filesystem. Here is an image to illustrate:
The directories linked to can have arbitrary numbers and levels of subdirectories, so hard-coding links on custom pages would probably be prohibitively complicated.
There is no web server involved here; the files are displayed by just opening index.html in a web browser, so .htaccess is not a solution. Also, I don't want to disable navigation, I only want to limit its upper bound.
Is there a way to prevent this access?
If there is no web server involved at all, there is no way to prevent that behaviour.
Edit:
You could of course write a browser plugin that limits the access to the parent directory using JavaScript. But every client would have to install that plugin.

Is it possible to access and list files of local system in web browser.

My requirement is to show a panel where I list the local system directory, from where I drag and drop the files inorder to perform operations on it.
In HTML5 the FileSystem API is available , but most of the browsers are not supporting.
Is it possible by using input type as file? Like we browse and select a directory, then we can see the list of files and their details?
As the previous commenters correctly noted, this is not possible because it is considered a security hole. Think about a malicious script that could read out everything on your local file system just by visiting a web page.
You can however implement file drag-and-drop like this: https://github.com/moxiecode/plupload

Abobe Air/Flex 4.6 Remote File Viewer

I have a Air/Flex desktop application and I'm trying to create a component within the app that can view files on the web server is is already connected to. It just needs to access one particular folder that will contain PDFs, Images & Word documents. I also want the ability to click on the files and having them open in their default desktop applications.
Is this possible and how would I go about doing this?
It's possible but not with your Flex/AIR app alone. It cannot view files/directories on server by itself but it can communicate with your server via webservices, AMF, or any other back end based service. Typically the back end reads the folder and send this information to your app. Your app can open those files in corresponding app but only if those files are available on disk so your app will have to download them prior to opening them.
Every Application has different needs but I myself usually save anything to a desktop or you can use the App storage container as well. As I use only the desktop I download what is needed OR been asked for, and the visitor has the choice of keeping it or if not needed it gets automatically deleted! this way you can use whatever PDFs, Word, Images etc. use read and write (re-write) as well as creating PDFs on the fly with Images, text etc, and that way a visitor also can print directly at his or her own leisure. regards aktell

Distribute html app on pendrive

I have an html app, with html, js, css and images, which I need to distribute on a pendrive for Mac and PC. When users open the app, however, they're receiving security errors in their browser.
I'm looking for a simple solution to this, but I can't find any easy way of opening a html app from a pen drive. Any solutions would be greatly appreciated.
EDIT:
You are right The error come from ajax local call to xml files.
Anyone has a solution ?
In reference to question - How can I make local ajax calls to xml files when distributing my html project locally?
The users who are having problems is probably due to the browser they are using and the state the browser was initialised in, as some browsers by default allow local ajax calls to files and some don't.
You have two options.
To your users specify a browser to run it in (for example chrome automatically disallows local ajax calls however if started with the flag --allow-file-access-from-files it will allow this behaviour)
Host the files on a web-server either in the flash drive or externally.
I think I have the solution.
With the mongoose portbla web server, I can launch a small web server without installation on mac an pc.
I just have to find how to put my page as default.
I wish it will help someone with the same problem.

HTML5: What should server do when user uploads folder?

HTML5 does not allow directory upload.
But inevitably, some users will end up uploading a folder, because they don't know about HTML5 rules.
The uploaded folder is just a small file.
How should I handle those cases?
Should I pretend the user really wanted to upload this small (probably meaningless) file?
Should I try to check if uploaded file is actually a folder, and warn the user if it is? (the actual data of a folder file is different on every OS, so not that easy)
Is it the browser's fault, should Chrome prevent the user from HTML5-uploading a folder?
Note: Alfresco uses the first strategy. If you know any application that uses the second strategy I would be glad to hear about it.
Alfresco has recently changed their strategy to the second strategy.
If the uploaded item is a folder or has a null size, it is refused server-side, and the Web UI tells the user.
I guess it is the best thing to do for now.