ASF File Explorer released
This is a project that started small and became a complete application. After much work on it, we are finally ready to release it.
ASF File Explorer is a file manager to browse, add, and remove directories and files from a specific server location.
Main features
- Browse directory trees in an intuitive tree interface
- Create folders
- Rename folders
- Delete folders
- View all files in currently selected directory with file type icons, size and last modified information
- Delete files
- Upload files to currently selected directory
- Limit file extensions from configuration file
- Upload file with progress bar to indicate bytes uploaded
- Upload multiple files at once
- Download and save a file
- Rename files
- Browse an FTP server
- Can be extended to use other component that implements the same file/directory functions (getDirectories, getFiles, renameFolder, etc)
It was built using CFForms and Flash remoting. My favourite feature is the multiple file upload, for which we have made an update to the file upload swf . The next step is to upgrade our flashupload custom tag to allow for multiple files.
We do not have a live demo running, but you can see a movie that shows most of the features. You can download it, see more screenshots and view more information in the project page:
Notes:
FTP is not very reliable and it has not been tested much. I got it to work on my server but not in my local CF installation and I didn’t have the time to look into it much.
We hope you find a use for it, and that you like it so much that you’ll be inspired to get us something from our Amazon wish list ;)
Chris
http://floe.unic8.com/demo/
user: demo
pass: floe2K5
it´s beta but will be released soon.
greets
John Barrett
Thank you for making this`-`
I have been hoping for something like this.
I love it, but I was not able to get it to work on the mac:(
I will be trying more, I keep getting errors(could not find componet/or code base). I am very new to coldfusion,and I would like to say that the work you have done with flashforms is inspiring`-`
How do I get you something on your wishlist?
Thanks again for sharing your wonderful project
John
Willem
I just have to ask Chris about his FLOE app
if that is a FLEX 2 app or is it made in cfform and if it is cfform how did you do the fade out effect when you load alerts?
Brian Rinaldi
Neil
Any plans to make any of the available features permissions dependant?
Rick Smith
6dust
Laura
John,
We have a link to our Amazon wish list in the post. Thank you! :)
Neil,
I didn't have any plans on implementing that although it would be a good feature. I don't think I'll do it because every developer has a different way of managing permissions. It should be easy to customize to your particular set of roles, users, etc.
6dust,
That is a problem resolved in this hotfix (and subsequent cumulative hotfix) http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=f97044e. But you don't need to install it because I just updated the source to avoid the problem. Please download it again.
Laura
I did not test it on a mac, but it should work. Where did you place the files? It should work as is if you put a folder called fileexplorer in your web root. If you don't have that configuration, then you will need to change the settings in the fileexplorer.ini file (managerComponent and servicesPath settings), there are comments there that might help you figuring what to write. I could help you a little more if you tell me where your files are located.
6dust
John Barrett
I send you 2 e-mails, thank you so much for all your help`-`
I got everything working now, just needed to add the folder,"fileexplorwer",and make the changes in the fileexplorer.ini file.
I didn't see the link to amazon yesteday, I was looking on the side, but enjoy`-`
Thanks again for making this application, truely wonderful`-`
John
Tony
Vincent
I have also a mac and it works well but the default ini won't work.
For the components path, the easiest way to know the right path is to create an empty file in the same folder, open your component window in dreamweaver and drag the manager component and the service component.
Then you just need to copy-paste the path that's directly inserted in the invoke component tag.
For the root Directory, you need to adjust from the root of your hard drive and use / instead of the :
To get the root Directory of your application, use Dreamweaver "Manage Site", click "Edit" and go to Part 3 "Where on your computer do you want to store your files?"
Use this path and change the : to / and remove the Macintosh HD at the beginning.
For example, mine is like this:
Macintosh HD:opt:ColdFusionMX7:wwwroot:myapp
The fileexplorer root directory would be:
/opt/ColdFusionMX7/wwwroot/myapp/
Hope this helps!
Vincent
David Brannan
I have a login script that checks against our LDAP directory then creates a session (outside of your Application.cfc) with the username (also the same name for the directory I wish to point them to).
The rootDirectory and final directory is set in your Application.cfc under OnSessionStart. I can't seem to pass in an already created session to an OnSessionStart area.
Any suggestion? I'm willing to share my LDAP login script if I can get it working.
Laura
No, that is not possible :(
David,
You bring up an important issue. I think the way I wrote the onsessionStart function will not really work so easily for those under a password protected area.
The problem is that onSessionStart runs as soon as the user hits the page for the first time (or the first time he/she hits the page after their session has expired). Because when that happens they are not yet logged in, you must do all the authentication, login forms, etc, until they are authorized. It is then when you want to set the root directory they will use (only if it changes for each user). That means you want to transfer this code:
<cfset session.fileManager = createObject("component",GetProfileString(variables.config, "default", managerComponent")).init(someDirectoryForThisUser,GetProfileString(variables.config, "default", "allowedExtensions")) />
to where you determine that they are logged in. If that is not in Application.cfc, then you can not use variables.config, but you can manually enter those settings, or do some other workaround.
David Brannan
That makes good sense. I suspect most people wanting to use your cool little app will need to impliment it into a password protected area.
I've moved that code to the login area and attempted to hardwire in the necessary variables since I cannot use variables.config:
rootDir
manageraComponent
allowedExtensions
The code looks like this:
<cfscript>
managerComponent="fileexplorer.com.blueinstant.FileManager";
allowedExtensions = "*";
</cfscript>
<!--- will eventually come from session --->
<cfset rootDir = "E:\Home\Staff\david.brannan\" />
<!--- create the object for this session --->
<cfset session.fileManager=createObject("component",managerComponent).init(rootDir,allowedExtensions)/>
But the app errors when looking for all the request.fileManagerProps
Sigh.... so close.
thinman
The name is not a valid component name.
Component names cannot start or end with dots.
The error occurred in C:\Websites\sohocentriccom\html\fileexplorer\Application.cfc: line 65
63 :
64 : <!--- create the object for this session --->
65 : <cfset session.fileManager = createObject("component",GetProfileString(variables.config, "default", "managerComponent")).init(rootDir,GetProfileString(variables.config, "default", "allowedExtensions")) />
Kirk Mower
Anastasios Abanidis
Is it possible to run this App unter https Protocol?
Laura
You are not using Application.cfc, right? if that is correct, you will need to reproduce what is there in your own application. You are missing: <cfset request.fileManagerProps = application.fileManager /> but since you are not using Application.cfc, you are probably also missing application.fileManager set up in the method onApplicationStart()
thinman,
Your error indicates that you have something like ".somePackage.someComponent" in your ini file. Make sure this setting does not have a dot in the beginning:
managerComponent=fileexplorer.com.blueinstant.FileManager
Kirk,
This application is very flexible regarding the directory structure you use. But you need to be able to browse it :)
By web root I mean your web-accessible public folder. You don't have to put in the "root", but it has to be somewhere below your web root (or virtual directory). It does not require any mapping, although you can use mappings for the manager component setting and move what is in the folder com/blueinstant/ somewhere else, changing the settings in the ini file accordingly.
Anastasios,
The application should work fine. However, there is a bug in the Flash Player that makes file upload fail under https. I don't know if the bug has been fixed in the newest player.
Doug
Doug Bedient
Anastasios
Im found on this Page the newest Flash Players for Windows an Mac.
Flash Player 8.5 (Alpha 3)
http://www.macromedia.com/cfusion/entitlement/index.cfm?e=labs#flashplayer8_5
With this Players the upload works also with https secure socket layer protocol.
Test on following Systems working fine:
Windows XP German SP2 - IE 6.0.2900,
Windows XP German SP2 - Firefox 1.04,
Windows XP German SP2 - Opera 8.0 Buil 7561,
Windows 2003 Servers German SP1 - IE 6.0.2900,
Mac OS X 10.4 - Safari
Mac OS X 10.4 - Camino - 2005110708 (1.0b1)
Mac OS X 10.4 - Firefox - 1.5
The Player from the official Macromedia Player Download Site dont work! (Version 8.0)
Greetings and thanks
Anastasios
Neil Huyton
Great app!!
I uploaded a large file (108MB) to see how long it would take and if things would timeout etc.
It uploaded fine, but when I try and download it, instead of the download dialog box popping up like the other files (images, swfs etc.) I get directed to download.cfm which shows a "500 null" error.
Any ideas why? Is it becasue it's a large file?
Thanks
Jeremy
Could not find the ColdFusion Component fileexplorer.com.blueinstant.FileManager.
Please check that the given name is correct and that the component exists.
The error occurred in /var/www/html/elg/Application.cfc: line 34
32 : <!--- only create the object on the application if we are using application storage as opposed to session storage --->
33 : <cfif GetProfileString(variables.config, "default", "managerStorage") EQ "application">
34 : <cfset application.fileManager.manager = createObject("component",GetProfileString(variables.config, "default", "managerComponent")).init(GetProfileString(variables.config, "default", "rootDirectory"),GetProfileString(variables.config, "default", "allowedExtensions")) />
35 :
36 : <!--- ftp --->
Laura
I don't know whether or not your problem is due to the file being large. I've never seen that error. Did you try downloading other large file that was not uploaded with Flash? Although suppously you can upload files of any size, the player officially supports up to 100MB.
Jeremy,
I think you have a different folder configuration in your server and therefore need to change the ini file. Read the comments there. I don't know where your web root is, but if it is at html (and all else is as you opened it form the zip), then you'll write
servicesPath=elg.services
managerComponent=elg.com.blueinstant.FileManager
Hope that helps
Tim
i want to send you some info so that you may make a post on how to add flash menu items to a cfgrid. can you email me so that i may send you the info or can you post a new article on how one could do it.
thanks
Tim
[email protected]
Roger
I installed the file explorer in 2 different places since I only wanted certain users to access certain directories.
However, I forgot to change the managerStorage to session instead of application.
Now I believe that since I ran the file explorer already, the rootDirectory is stored in memory. Therefore, I have to wait until CFMX 7 restarts on my web hosting server. Is there a way to kill this application object manually.
thanks.
roger
Randy
Here is my first an interesting issue that you may have a workaround to handle.
The issue that I have run across is this. When I wrap the contents of a <cfform format="flash"></cfform> inside of a <cfsavecontent variable="X"></cfsavecontent> tag, and then attempt to output my variable, either the object or the js code or both doesn't read correctly in the browser. However, the code does output correctly to the page source. Here are examples:
<!--- save cfform contents here --->
<cfsavecontent variable="X">
<cfform format="flash"> </cfform>
</cfsavecontent>
<!--- output variable contents here --->
<cfoutput>
#X#
</cfoutput>
This theoretically should output as though the code was any other html, js, or other code written by coldfusion server. However, the code produced simply sits in the source untouched and unread. It is truly bazaar.
So my question is are any of you aware of the issue and a workaround for it or can you point me in the direction of somone who maybe familiar with this problem? I have tried googling an answer to the problem but, I only get a bunch of tutorials on adding actionscript to cfforms using cfsavecontent.
If you dont know or know anyone who may know a workaround, I completely understand. thanks for any time you can put to this.
Take care,
Laura
Theoretically, you don't need to wait until the server restarts, only until the application times out, usually 2 days :)
But what I usually do when developing is to re-initialize the application by calling OnApplicationStart() in the onRequestStart method and then remove it when I am done. Or you could also change the name of the application (this.name). That will make OnApplicationStart run again since it would be a brand new application.
6dust
I've been hitting a problem a lot lately with my Flash forms, and noticed that it happens with this application too. If I attempt to resize my browser window (IE and FF) after the Flash form has loaded, the widths of the form groups go crazy and they all drop into a vertical line (it looks a lot like the infamous CSS float drop problem). Is there a known issue with this? Or is it maybe a bug w/ the Flash Player 8.5 beta?
Thanks!
Neil
You just need to put a width on your cfform. If you put a width on the file explorer, you can resize your browser and the panels will stay in place.
6dust
I've been hitting a problem a lot lately with my Flash forms, and noticed that it happens with this application too. If I attempt to resize my browser window (IE and FF) after the Flash form has loaded, the widths of the form groups go crazy and they all drop into a vertical line (it looks a lot like the infamous CSS float drop problem). Is there a known issue with this? Or is it maybe a bug w/ the Flash Player 8.5 beta?
Thanks!
6dust
Neil, so there is no way to have an auto-resizing 100% width? In my limited playing around with Flex, this seemed very doable...
Thanks,
6dust
Adam Fairbanks
Any plans for multiple file download (even if the files were just zipped)?
dan
Laura
you need to specify the absolute path of the folder you want to explore. ie: C:\inetpub\wwwroot\cneworks\wwwroot\someDir\otherDir
TC
Chris
the mentioned project "floe" was released today. i´ve already downloaded and installed it and it´s really cool.
Here´s the link... http://www.unic8.com
Noel
I'm trying the code on a Linux server running ColdFusion MX 7,0,1,116466
And guess what.. I'm get the following error:
Could not find the ColdFusion Component fileexplorer.com.blueinstant.FileManager.
I've made the needed changes in the fileexplorer.ini
Any tips?
Laura
Where do you have the com folder?
If you made the changes in the ini, did you somehow reset the application (restart the server, etc)?
Noel
re: com folder..
If you are talking about the "componentutils' folder it's in '/var/www/html/CFIDE' (there is a SymLink to it from the dir where I'm running the code from.
If it's not the 'com' folder you are talking about, than I do not have one! (as far as I can see)
re: restart the server, etc..
No I did not :/ I'll do the 'restart server' later today when I'm back home...
Thanks for the reply
Wally
Have I missed something for the installation?
Noel
I've found the 'com' folder.. It's in the applocation folder itself :)
I did read the info, and did change the rootDirectory in the fileexplorer.ini file to the place the index.cfm is located.
(/var/www/html/test/)
The 'com' folder is in /var/www/html/test/com
I'm still geting the same error 'Could not find the ColdFusion Component fileexplorer.com.blueinstant.FileManager.'
I'm sure that MX7+ is setup okay, as the 'File Upload with ColdFusion Flash Forms' and 'Showing an image after upload' applications are working fine from the same folder!
Could it be that I'm missing the 'Component fileexplorer.com', or do I need to move the 'com' folder to an other place?
Thanks again for any info about this...
Laura
Make sure you have the Application.cfc file in place.
Noel,
The settings assume you unzipped the file in a folder called fileexplorer in the root of your website. That is not your case, so...
Assuming the root of your website (where your public files are) is at /var/www/html, then you need to change this in the ini file:
servicesPath=test.services
managerComponent=test.com.blueinstant.FileManager
Hope that helps
Kevin
Next, my quetion...
We typically don't put our CF sites under the InetPub\wwwroot folder. We use a folder at the same level as wwwroot. We do this to keep the CFIDE directory out of the Web Tree for security reason (we don't want people to be able to access those files via the Web).
It seems like CFFORM automagically includes calls to the CFIDE/Scripts folder for CFFORM js and cfm files in order to work properly.
I tried to just copy the CFIDE/Scripts folder, the scripts inside, and the css and xml folders into our webroot. That got me a bit further in loading the application (got past the JS errors).
However, when I try to browse the directories or files within a directory using the app, i just the get pink-ish error strip at the top of the page with no text explaining what the error is. When I click on items, the browser indicates it is trying to read from the site and the progress bar in the pink-ish error bar at the top of the screen loads and progresses to the end very quickly. However, nothing happens.
If I upload a file, it actually uploads the file to the correct directory, but I cannot create a new folder, browse the folder tree (if just displays "getting sub directories" and then doesn't do anything), or view the files in a folder.
I'm assuming that there is another piece of the CFIDE directory that is missing and causing this to fail. It seems like maybe CFDIRECTORY tag isn't happy for some reason. But CFDIRECTORY works just fine in other places on the same Web site.
Have you (or anyone else out there) ever tried to run this app outside of the main wwwroot directory? I know we've ran into issues with serving CF sites outside the wwwroot in the past, but can usually find a way around them...
Thanks for any info on this issue!!
Noel
I've now moved the FTP and FileManager.cfc files to the same place as the index.cfm (and changed the .ini file), and all is working fine now.. (it's only a test server).
Later today I'll move the files one by one (and set the path in the .ini), and see what's going wrong with the path in the .ini file.
Thank you for your help.
Noel
It looks like uploading is not the problem as when I download the uploaded image with a FTP program, all is fine.
Someone here who can also test this?
6dust
Noel
Marilyn
Thought I had everything configured but I missed something. Get a CFFORMITEM attribute validation error because the type is script. Specifically
<cfformitem type="script" is where the error is thrown. Help/Suggestions - new at this and it's late ;-].
Thanks
Laura
I don't see any problem with images. I would open the image in notepad to see if there is anything extra added.
Marilyn,
You need the CF Updater (CF 7.01)
Laura
I also have all my websites in a different directory.
I think you have a problem with the remoting set up. You can read how to set it up in this post (the past paragraph) http://www.asfusion.com/blog/entry/introduction-to-flash-remoting
Marilyn
Found the problem right after the post naturally. Pays to update on a regular basis. Downloaded the coldfusion updater. Goodnight.
Felipe
Thank you
Felipe
Attribute validation error for tag CFFORMITEM.
The value of the attribute TYPE, which is currently "script", must be one of the values: HRULE,HTML,TEXT,VRULE,SPACER.
Neil
It looks like you don't have Coldfusion 7.01 installed.
The 'script' item isn't supported in CFMX 7.00.
Thanks,
Neil
Felipe
has anyone been able to get it to work with an FTP site. Is there a way to get it to prompt for the user name and password. It seems even when i put the user name and pssword i get the following.
The parameter PASSWORD to function init is required but was not passed in.
best regards
felipe
Kevin
Thanks for the link to your article...That was it exactly!! Things are up and running smoothly!
Thanks again for taking the time to create this tool, and for making it available!
If my client decides to use it, i will definitely be getting you something from your wish list with my first check from them!
Thanks again!
Kevin
John Farrar
Thomary
Laura
Thank you!
John,
You can include movies by using cfformitem type="html" or cftextarea html="true". That is how we get the file upload libraries and how we show the loading animation.
Thomary,
Thank you! we added a certificate to the wish list!
Tom
TOM
Tom
Ed Welch
Thanks
Ed
Aaron
--Aaron
Neil
The onChange event won't work? You can see all of the events that the TextInput field throws here: http://livedocs.macromedia.com/flex/15/asdocs_en/index.html
Just scroll down on the bottom left panel, and click on the TextInput link. Then, on the right, scroll down and take a look at the events. It looks like the equiv to onBlur is focusOut....
Aaron
Thanks for the response. I tried what you suggest, but the event does not fire. I assume this is because I am using coldfusion mx 7 with flash forms? Thanks for the help.
Aaron
--Aaron
Neil
It should definitely be working - all we write here are flash forms w/ CF7. Did you install the updater? I know for a fact that that the onChange event fires for text inputs - I use it literally in almsot every single form we write.
The onFocus event, however, I can't remember using so I can't speak to how it works. Did you take a look at the link I included in my last post? That link will show you all of the events that are available to the text input form element - or any other flash form element.
What is it that your specifically trying to do? Maybe I can help you out.
C
C
Answer is:
You just need to put a width on your cfform. If you put a width on the file explorer, you can resize your browser and the panels will stay in place.
Posted By Neil / Posted At 2/18/06 5:44 AM
Thanks NEIL!
GREAT APP!
Aaron
I have no problems with flash forms, I have been using the extensivly, with no problems. What I am doing is reading an XML Config file to dynamically generate the form fields. Then I need to read the values of the text fields in actionscript so I can pass them to the CFC to write a new XML file based upon user input. Since the config file is not static I need to be able to pass the field name to the Actionscript. Thanks again.
--Aaron
Aaron
I have no problems with flash forms, I have been using the extensivly, with no problems. What I am doing is reading an XML Config file to dynamically generate the form fields. Then I need to read the values of the text fields in actionscript so I can pass them to the CFC to write a new XML file based upon user input. Since the config file is not static I need to be able to pass the field name to the Actionscript. Thanks again.
--Aaron
Neil
In order to fire the event on a text field when the form loads and then the value is entered into it by the programming, you need to have an event listener. Look in the site index of the AsFusion website for "knowing when the form data arrives" or something like that, and for a text input the event you want to trap is, I think, valueCommitted.
Hope this helps. Sorry if I'm not understanding.
nb
Aaron
I got it to work. For some reason, probably coding error on my part, I couldnt get the onblur even to fire actionscript. It works now, so I am dynamically setting an actionscript array onblur. I will post a link to the source code when I get this fully functional. Thanks for the assistance.
--Aaron
TOM
Any help would be great..
TK
John Barrett
Should work on the mac, once I figured how how to configure it for the mac, works great!
What problem are you having? Check you .ini file,and make sure you have your path correct.
Maybe something like:
rootDirectory=/Library/Apache2/htdocs
and
treeRootLabel=/Library/Apache2/htdocs/fileexplorer/icons
If the main application loads sounds like you might have the path right. It works great on my powerbook. I have it working on Sfari, forefox, and camino.
Once the application loads open the main file to get the sub-directories, and click on the main folder to get the main wwwroot files. I made this mistake myself, but I am a real newbie.
If I can help in any way feel free to contact me.
John
TOM
TK
Lachie
Has anyone run this over an SSL? I have it set up in several locations on the same server but tried over an SSL and it loads up ok but when I select the tree on the left it says "getting directories" and never actually loads them.
Any thoughts?
Kind Regards
Lachie
John Barrett
That is an odd issue. I use it on the localhost, sounds like yours is online. Maybe talk to hosting company.Ruunig Apache on windows should not be a problem. I am lost,and have no idea how to help,sorry:(
Tjoolder
But I have a question.
Neil said: Although suppously you can upload files of any size, the player officially supports up to 100MB.
Is there a way to change it?
So I could upload/download files of 500Mb for example?
TIA!
Poolio
Tom S.
BM
When I attempt to expand the dir tree, I get the following error: "Service fileexplorer.services.fileExplorer not found."
I continue to get this error even though I update the .ini file to reflect the new path to the services dir. Works great when the fileexplorer dir runs form the web root. Can I not run this from a lower level directory?
Thanks.
Bm
But I would still like to know aboutbthe multiple dir ...?
Thanks.
Laura
When you make changes to the ini file, make sure you refresh the application by changing its name, restarting CF or running onApplicationStart().
keith
I continue to get this error even though I update the .ini file, I have changed the application name to refresh the application. Any ideas?
TW
;---- servicesPath -----
;the path from your web root to the services directory
servicesPath=services
servicesPath=fileexplorer.services.fileexplorer
servicesPath= fileexplorer.services
Anyone have any Ideas?
Larry
Someone prior asked about moving files between directories. I know it is not a feature now, but is it planned?
This would be vital to my users to easily move files between folders.
Is it possible to add drag and drop fucntionality to accomplish this?
Thanks.
Laura
The path depends on your web directory structure. It is still looking for the services at /fileexplorer/services in your web root. If that is not your path, then you need to change it in the ini and refresh the app as you describe.
TW,
Same thing, your app it is still looking at the old path. When you make changes to the ini file, make sure you refresh the application as I explained earlier (the settings are cached in the application scope so that they don't need to be read each time). I can't tell you what to write in the ini file because that depends on where you have the files with respect to your web root (/)
Larry,
Thank you.
Moving files was not in the TODO list. I just added it. Using drag and drop would be great, but no so easy to implement as we would need to handle errors, duplicates, etc. It can be done, of course, we just need ot make intuitive.
Thomas Moore
Base path does not exist
The error occurred in /home/httpd/html/nevadapower/fileexplorer/com/blueinstant/FileManager.cfc: line 38
36 : <!--- check that the base path exists --->
37 : <cfif NOT directoryexists(variables.basePath)>
38 : <cfthrow message="Base path does not exist"/>
39 : </cfif>
Laura
It means that the rootDirectory setting you wrote in the ini file does not exist. :)
Read the comments in the ini file for help on what to write there.
capcomms
Regards
</cliff>
James W.
James W.
Thanks
Tim V.
1> When I try to rename a file I get the following error: "Attribute validation error for tag CFFILE."
2> When I try to rename a directory I get a message saying: "The specified Directory attribute C:\Data\Webs\Engineering\test cannot be renamed to NewDirectory C:\Data\Webs\Engineering\test2"
3> When I try to delete a directory I get the message: "The specified Directory attribute C:\Data\Webs\Engineering\test2 cannot be deleted"
My directory setup for FileExplorer is as follows: C:\Data\Webs\Engineering\filexplorer\ and as I mentioned everything else works great; upload, download, create folder.
Can you help please? Thanks
Tim V.
Okay - that's all - hope you can help. Thanks again.
Laura
Many people have experienced problems with large files. Nothing we can do since it is a player issue.
James,
Unless you want to modify the app, you don't need to know ActionScript or remoting. As far as documentation, there is a Readme file for install instructions, and the application.cfc and ini files have lots of comments explaining what to do. However, if you want to learn about remoting and flash forms, I would recommend looking at the posts in the Flash Remoting category. Not that you will find everything you'll ever need to know, but at least it will get you started. Otherwise, go to the source, Adobe's docs.
Regarding sending additional info, the answer is no. Only Flash player 9 adds that functionality.
Tim,
Have you checked permissions on those folders/files? I would manually run <cffile> on a regular cfm file with those folders and files as attributes and see if I can get more information about the error.
Tim V.
You were right - it was permissions. When I changed the folder permissions everything worked. Thanks again for a terrific product and great support!
Tim
Chad Wagner
Tom
Todd
I absolutely love this app! I am currently using this in a shared hosting environment and ran into an issue out of nowhere. I am now getting the following error when I try to expand the root directory:
Element FILEMANAGER is undefined in a Java object of type class [Ljava.lang.String; referenced as
I haven't made any changes and don't have the ability to bounce the CF server. Any ideas?
Roger
roger
Laura
Did you make any change to the Application.cfc file? Are you using session storage? Try changing the name of the application and see if you still have the error.
Roger,
No, unfortunately ASF File explorer requires cfdirectory. You could, however, implement a manager that uses Java to get the directories, but I doubt your host will let you do that if they don't let you use cfdirectory.
Will
<cfcontent type="#mimeType#"><cfoutput>#filecontent#</cfoutput>. I changed to the code to <cfheader name="Content-Disposition" value='attachment; filename="s4004"'>
<cfcontent
file="D:\INETPUB\highlandshistoricalconsulting\projects\project3\catherine\s4004">
deleteFile = "no">
. This worked fine using Mozilla Firefox browser, but failed using IE 6.0. Can you explain why? Is there a fix?
Thanks
Ed
Laura
I don't think Flash Player supports windows authentication.
Laura
I don't know, but it might be that since your file name doesn't have an extension, it doesn't work on IE. I also had <cfcontent type="#mimeType#"> in my code to help the browser guess what to do with the file.
George
Conrad
I need help, I try to implement the upload example that appear in the ASF File Explorer in an Event Registration App that look like the Real Estate Sample Application.
When I open the Application the Browse and Upload button work perfectly, but if I press the Search button and load the data both button didn’t work anymore until I refresh the page.
Here the code of the both Scripts;
<cfformitem type="script">
public function formOnLoad():Void{
RealEstateAdmin.myGlobalObjects = {};
RealEstateAdmin.myGlobalObjects.isEditMode = false;
checkVersion();
<!--- set up remoting service --->
setUpRemoting();
<!--- set up styles --->
setStyles();
editForm.setStyle("backgroundColor", 0xCDE4F6);
}
public function setUpRemoting():Void{
<cfoutput><!--- cfoutput to be able to set the gateway dynamically. It is recommended however to write the actual gateway instead --->
var connection:mx.remoting.Connection = mx.remoting.NetServices.createGatewayConnection("http://#cgi.HTTP_HOST#/flashservices/gateway/");
<!--- this should evaluate to
var componentPath = realestate.services.AutorService";
componentPath variable is controlled in Application.cfc for more flexibilty on where the sample application has been saved
--->
var componentPath:String = "#request.componentPath#.services.ParticipanteService";
</cfoutput>
var responseHandler:Object = {};
<!--- put controls in the responseHandler's scope --->
var listingGrid:mx.controls.DataGrid = listingGrid;
<!--- handle search by default onResult function --->
responseHandler.onResult = function( results: Object ):Void {
listingGrid.dataProvider = results.items;
_root.setMode('add');
mx.managers.CursorManager.removeBusyCursor();
}
<!--- handle create response --->
responseHandler.create_Result = function( results: Object ):Void {
if (results.status){
listingGrid.addItemAt(0,results.item);
_root.setMode('add');
}
mx.managers.CursorManager.removeBusyCursor();
//show a message
alert(results.message);
}
<!--- handle update response --->
responseHandler.update_Result = function( results: Object ):Void {
var item:Object = results.item;
var index:Number = _root.findItem(listingGrid,'par_codigo',item.par_codigo);
if (results.status && index >= 0){
listingGrid.replaceItemAt(index,item);
}
mx.managers.CursorManager.removeBusyCursor();
<!--- show a message --->
alert(results.message);
}
<!--- handle remove response --->
responseHandler.remove_Result = function( results: Object ):Void {
if (results.status){
listingGrid.removeItemAt(_root.findItem(listingGrid,'par_codigo',results.item.par_codigo));
_root.setMode('add');
}
mx.managers.CursorManager.removeBusyCursor();
<!--- show a message --->
alert(results.message);
}
<!--- default error handler --->
responseHandler.onStatus = function( stat: Object ):Void {
<!--- if there is any error, show an alert --->
alert("Error: " + stat.description);
mx.managers.CursorManager.removeBusyCursor();
}
<!--- store service in global variable --->
RealEstateAdmin.myGlobalObjects.ParticipanteService = connection.getService(componentPath, responseHandler );
}
<!--- sets all the global styles --->
public function setStyles():Void {
_global.styles.ComboBox.setStyle("color", 0x00253D);
_global.styles.Label.setStyle("color", 0x222222);
_global.styles.CheckBox.setStyle("color", 0x00253D);
_global.styles.RadioButton.setStyle("color", 0x00253D);
_global.styles.Form.setStyle("color", 0x222222);
_global.styles.Button.setStyle("color", 0x222222);
_global.styles.Button.setStyle("borderThickness", 1);
_global.styles.Panel.setStyle("backgroundColor", 0xE5F0F9);
_global.styles.Panel.setStyle("color", 0xffffff);
_global.styles.Panel.setStyle("headerColors", [0x277DC6,0x50ABF7]);
}
<!--- helper function to select items in a dropdown --->
public function selectOption(select: mx.controls.ComboBox, optionToSelect:String):Void{
//go through every record to find the right one
for (var i:Number = 0; i< select.length; i++) {
if (select.getItemAt([i]).data == optionToSelect){
select.selectedIndex = i;
break;
}
}
}
<!--- helper function to find an item in a datagrid --->
public function findItem(grid:mx.controls.DataGrid, columnToSearch:String, id:String):Number {
for (var i = 0; i < grid.dataProvider.length; i++){
if (grid.getItemAt(i)[columnToSearch] == id){
return i;
}
}
<!--- not found --->
return -1;
}
<!--- function that gets called when grid selection changes, used to bind other controls to grid values --->
public function listingGridChanged():Void {
edit_pa_codigo.selectedIndex = 0;
edit_sca_codigo.selectedIndex = 0;
edit_sgd_codigo.selectedIndex = 0;
edit_par_sexo.selectedIndex = 0;
edit_atp_codigo.selectedIndex = 0;
edit_at_codigo.selectedIndex = 0;
edit_ev_codigo.selectedIndex = 0;
<!---edit_par_imagen.selectedIndex = 0;--->
selectOption(edit_sca_codigo, listingGrid.selectedItem.sca_codigo);
selectOption(edit_pa_codigo, listingGrid.selectedItem.pa_codigo);
selectOption(edit_sgd_codigo, listingGrid.selectedItem.sgd_codigo);
selectOption(edit_par_activo, listingGrid.selectedItem.par_activo);
selectOption(edit_par_sexo, listingGrid.selectedItem.par_sexo);
selectOption(edit_ev_codigo, listingGrid.selectedItem.ev_codigo);
selectOption(edit_atp_codigo, listingGrid.selectedItem.atp_codigo);
selectOption(edit_at_codigo, listingGrid.selectedItem.at_codigo);
<!---selectOption(edit_par_imagen, listingGrid.selectedItem.par_imagen);--->
<!--- edit_status.selectedData = listingGrid.selectedItem.status;--->
if(listingGrid.selectedItem == undefined) {
setMode('add');
}
else {
setMode('edit');
}
listingGrid.setFocus();
}
<!--- function that makes necessary changes to show add/edit toggle --->
public function setMode(mode:String):Void{
if (mode == 'add'){
actionMessage.text = 'Esta agregando un participante';
RealEstateAdmin.myGlobalObjects.isEditMode = false;
listingGrid.selectedIndex = undefined;
editForm.setStyle("backgroundColor", 0xCDE4F6);
actionMessage.setStyle("color", 0x235986);
resetForm();
edit_pa_codigo.selectedIndex = 0;
edit_sca_codigo.selectedIndex = 0;
edit_sgd_codigo.selectedIndex = 0;
edit_par_sexo.selectedIndex = 0;
edit_ev_codigo.selectedIndex = 0;
edit_atp_codigo.selectedIndex = 0;
edit_at_codigo.selectedIndex = 0;
<!---edit_par_imagen.selectedIndex = 0;--->
}
else{
actionMessage.text = 'Esta editando un participante';
RealEstateAdmin.myGlobalObjects.isEditMode = true;
editForm.setStyle("backgroundColor", 0xCCDCF2);
actionMessage.setStyle("color", 0x19316E);
}
}
<!--- :::::::::::::: Remoting calls ::::::::::::::::::::::::::::::: --->
<!--- editing / adding a listing --->
public function submitEdit():Void {
var editArguments:Object = {};
<!--- simple text inputs --->
editArguments.par_nombre = edit_par_nombre.text;
editArguments.par_apellido = edit_par_apellido.text;
editArguments.par_sexo = edit_par_sexo.value;
editArguments.pa_codigo = edit_pa_codigo.value;
editArguments.sgd_codigo = edit_sgd_codigo.value;
editArguments.sca_codigo = edit_sca_codigo.value;
editArguments.ev_codigo = edit_ev_codigo.value;
editArguments.par_email = edit_par_email.text;
editArguments.par_fecha_nac = edit_par_fecha_nac.text;
editArguments.par_comentario = edit_par_comentario.text;
editArguments.par_activo = edit_par_activo.text;
editArguments.par_imagen = edit_par_imagen.text;
editArguments.par_telf_cel = edit_par_telf_cel.text;
<!---editArguments.par_telf_sos = edit_par_telf_sos.text; --->
editArguments.atp_codigo = edit_atp_codigo.value;
editArguments.at_codigo = edit_at_codigo.value;
<!--- only make call if all required fields are supplied --->
if( mx.validators.Validator.isStructureValid(this, 'RealEstateAdmin') ){
<!--- show clock cursor --->
mx.managers.CursorManager.setBusyCursor();
if (RealEstateAdmin.myGlobalObjects.isEditMode) {
<!--- call service --->
editArguments.par_codigo = edit_par_codigo.text;
RealEstateAdmin.myGlobalObjects.ParticipanteService.update(editArguments);
}
else {
<!--- call service --->
RealEstateAdmin.myGlobalObjects.ParticipanteService.create(editArguments);
submitSearch();
}
}
}
<!--- removing a listing --->
public function submitRemove():Void {
<!--- call service, sending the id --->
RealEstateAdmin.myGlobalObjects.ParticipanteService.remove(edit_par_codigo.text);
}
public function submitAlert():Void {
var myClickHandler = function (evt){
if (evt.detail == mx.controls.Alert.YES)
{
submitRemove();
alert("Records deleted","Completed");
}
}
var myAlert = mx.controls.Alert.show("Are you sure you want to remove the checked records?", "Warning",
mx.controls.Alert.YES | mx.controls.Alert.CANCEL, this, myClickHandler);
}
<!--- this function is called when search button is clicked --->
public function submitSearch():Void
{
<!--- get all the search criteria items --->
var searchArguments:Object = {};
searchArguments.pa_codigo = search_pa_codigo.selectedItem.data;
<!--- show clock cursor --->
mx.managers.CursorManager.setBusyCursor();
<!--- call service --->
RealEstateAdmin.myGlobalObjects.ParticipanteService.search(searchArguments);
<!---RealEstateAdmin.myGlobalObjects.ParticipanteService.reload();--->
}
function applyFilter( term:String, grid:mx.controls.DataGrid, columns:Array ):Void {
var filterTerm:String = term.toString().toLowerCase();
if(filterTerm.length > 0) {
if(_global.unfilteredData[grid.id] == undefined){
if (_global.unfilteredData == undefined){
_global.unfilteredData = {};
}
_global.unfilteredData[grid.id] = grid.dataProvider.slice(0);
}
var filteredData:Array = [];
for(var i = 0; i< _global.unfilteredData[grid.id].length; i++) {
var item:Object = _global.unfilteredData[grid.id][i];
var added:Boolean = false;
for(var j = 0; j< columns.length; j++){
if(!added){
var value:String = item[columns[j]].toString().toLowerCase();
if(value.indexOf(filterTerm) != -1) {
filteredData.push(item);
added = true;
}
}
else {
break;
}
}
}
grid.dataProvider = filteredData;
}
else {
if(_global.unfilteredData[grid.id] != undefined) grid.dataProvider = _global.unfilteredData[grid.id];
}
}
<!--- after a file has been uploaded --->
public function fileUploaded():Void{
edit_par_imagen.text = "";
}
</cfformitem>
<cfformitem type="script">
var description:String = "Images Files";
var extension:String = "*.jpg;*.png;*.gif";
var uploadSwf:Object;
var totalSize:Number;
var swfInitialized:Boolean = false;
var maxSize:Number = 1024 * 300;
var path:String;
public function checkVersion():Void
{
var version = getVersion();
var versionNumber = Number(version.substr(4,1));
if(versionNumber < 8)
{
var msg = '<p>Uploading files requires Flash Player 8 <br><font color="#0000ff"><a href="http://www.macromedia.com/go/getflashplayer8">Please download it from Adobe</a></font></p>'
var alertSettings:Object = {title:'Warning', message: msg, width:200, headerHeight:27 }
errorpopup = mx.managers.PopUpManager.createPopUp(this, FormErrorException, true, alertSettings);
errorpopup.centerPopUp(this);
}
}
public function browse():Void
{
if(!swfInitialized) initSwf();
uploadSwf.browse([{description: description, extension:extension }]);
}
public function initSwf():Void
{
swfInitialized = true;
uploadSwf = swfHolder.label.upload;
uploadSwf.addListener(this);
}
public function upload():Void
{
path = 'upload.cfm';
uploadSwf.upload(path);
}
public function onSelect(fileRefList:Object):Void
{
var list:Array = fileRefList.fileList;
var selectedFile:Object;
totalSize = 0;
var tooltipText = "";
var filesName:String = "";
for(var i:Number = 0; i < list.length; i++)
{
selectedFile = list[i];
totalSize += selectedFile.size;
filesName += selectedFile.name + "; "
tooltipText += selectedFile.name + "\n"
}
if( totalSize < maxSize || maxSize == null)
{
uploadBtn.enabled = true;
edit_par_imagen.text = filesName;
}
edit_par_imagen.toolTip = tooltipText;
}
public function onProgress(fileRef, bytesLoaded, info:Object):Void
{
progressBar.visible = true;
var totalWidth = progressBarBackground.width;
var bytesTotal = totalSize;
var kLoaded = bytesLoaded/1024;
var kTotal = bytesTotal/1024;
var loaded = (kLoaded < 1024) ? MathNumberParse(kLoaded) + " KB": MathNumberParse(kLoaded/1024) + " MB";
var total = (kTotal < 1024) ? MathNumberParse(kTotal) + " KB": MathNumberParse(kTotal/1024) + " MB";
var percentage = Math.round(bytesLoaded * 100 / bytesTotal);
output.text = percentage+ "% uploaded - ";
output.text += loaded + " of " + total;
output.text += " - " +info.index +" of "+ info.filesNum + " file(s)";
<!---progressBar.width = totalWidth / 1000 * percentage;--->
}
public function MathNumberParse(n):String
{
return (n >> 0)+"."+ (Math.round(n*100)%100);
}
public function onFileComplete(file:Object):Void
{
output.text = file.name + " Loaded";
}
public function onComplete(file:Object):Void
{
output.text = "Transfer successful";
progressBar.visible = false;
<!---fileUploaded();--->
}
public function uploadError(value):Void
{
output.text += value;
}
</cfformitem>
frank
One thing - is it possible to select multiple files to download?
Anyone modified this to select multiple files to download?
Thanks
Leo
Here is the location of the folder at web root. I updated the ini with different combinations with no success.
D:\home\sites\freesohocrm.com\wwwroot\fileexplorer\
Here is what I updated. Is this correct?
rootDirectory=D:\home\sites\freesohocrm.com\wwwroot\fileexplorer\
How about servicesPath and managerComponent?
Here is the error message:
D:\home\sites\freesohocrm.com\wwwroot\fileexplorer\index.cfm: line 57
Called from D:\home\sites\freesohocrm.com\wwwroot\fileexplorer\index.cfm: line 56
Called from D:\home\sites\freesohocrm.com\wwwroot\fileexplorer\index.cfm: line 1
55 : <body>
56 : <cfform name="FileExplorer" format="Flash" timeout="999" onload="formOnLoad()" style="themeColor:##56A1E1;">
57 : <cfformitem type="script">
58 : var rootVerified:Boolean = false;
59 : var remotingService:mx.remoting.NetServiceProxy;
George
Thanks
Laura
Whenever you change the ini file settings, do as I describe in this response: http://www.asfusion.com/blog/entry/asf-file-explorer-released#comment-1513
The root directory can be any directory that exists that you want to let the user see.
For servicesPath, it think the default, fileexplorer.services, should work since you have the app in the fileexplorer directory off the root of your site. Same for managerComponent. However, from the line number, I think your problem is something else, do you use CF 7.01?
George,
You need to remove line 84 where it says: directories.editable = true;
Chris Pettigrew
Dan Fredericks
Glen20
Fantastic GUI, and all round application!!! Ive installed it all to my web server online, but i am having the problem of it recognising all changes to the fileexplorer.ini except when i change the "rootDirectory=" command. It is consistenly using the path i specified the very first time i put it on my web server. I have tried numerous methods to try and get around this ie( changing the application name as mentioned in an earlier post, changing the fileexplorer.ini name etc) but it is still recognising all changes except the one to the "rootDirectory". Any ideas of why? Im thinking it has saved the fileexplorer.ini to another web directory i dont have access too and is not refreshing that section of the fileexplorer.ini (this is weird because why only the rootDirectory not changing), but really not sure. Seriously great job with this application Laura!
I dont know if this will assist anyone who is getting the HTTP 500 error when uploading but i managed to fix this problem by getting my web server administrators to allow a few Tags that were in my sandbox. By default i think they block a lot of them when you have a server which is hosted externally. This being the reason why it WILL work on your home test server and not in production on an external server.
Ken Mun
I'm experiencing the same problem as Todd. Whereby the application was running fine until I installed the CFMX7 Updater 2. Which updates CFMX to version 7.0.2. Could this be the culprit?
Is there an update I can download to fix this? Please help ..
John
Ernie Pena
I have moved my INI to a different directory and I set that at the top of the application.cfc
variables.config = "D:\export\home1\www2\htdocs\depts\leukgleevec\Admin\fileexplorer.ini";
Element FILEMANAGER.MANAGER is undefined in APPLICATION.
The error occurred in D:\export\home1\www2\htdocs\depts\leukgleevec\explorer\Application.cfc: line 51
49 : <cfif GetProfileString(variables.config, "default", "managerStorage") EQ "application">
50 : <!--- if storage type is application, all the users will get the same file manager object (and therefore the same root folder to explore) --->
51 : <cfset session.fileManager = application.fileManager.manager />
52 : <cfelse>
53 : <!--- assume it is session-based storage.
Wender
i read the code any times but i can't understand one little think...
how can i to determine multiple file selection at once?
Vu
Thanks
Laura
I would check whether Remoting is working fine in your server. Do other Flash forms load data?
Jason Lim
Anyone know what's wrong?
taylor
I have the same problem.
"The upload function works on a PC, but not on a Mac. I open it up in IE or firefox on the pc and it works fine. I try it with Safarri and Firefox on the mac, it just sits there."
I've tried updating to the latest flash plugin 9 and it still doesn't work.
I hardcode the root directory so that works but if I drill down to its subdirectory, I can create,update, and remove folders but I cannot upload a file to those folders.
My guess is that the session for upload is not being set. Anyone have any other ideas? Better yet, any good debuging approach/ideas? I've been using alerts but that doesn't help me see what filename,path,filefield is being passed to the uploadFile function in the FileManager.cfc.
Also, anyone know where the form post "Filedata" is coming from in upload.cfm? My guess is the fileUploader.swf if so, what is it doing?
Sorry, I'm new to this whole thing.
I think it is an awesome app so thanks. If my designers doesn't use Macs I'd be so much happier but for now I have to fix this issue for them.
Laura
I know what the problem with mac is. I just haven't had the time to fix it :(
It has to do with the way I am sending the path to where to upload the file. In the query string, I say something like: upload.cfm?path=/myDirs/aSubDirectory/ and for some reason, the Flash Player for mac does not want to send the request if the url has the forward slashes. That is why it works fine if you try to upload directly to the root instead to a subdirectory. Anyway, I will have to change the path separator to make it work.
Filedata is the form field that Flash upload sets with the contents of the uploaded file when it sends the request. You cannot change it. See the documentation for uploading with Flash for more info.
taylor
What do you think about this as a quick solution (upload.cfm):
<cfif structkeyexists(form,"Filedata")>
<cfif findNoCase("mac",CGI.HTTP_USER_AGENT, 1) >
<cfset url.path = replace(url.path,"\","/") />
</cfif>
<cfset session.fileManager.uploadFile("Filedata", url.path, form.filename)/>
</cfif>
This way you can continue to pass back slash for all operating system to upload.cfm and let upload.cfm do the converting. The only problem is, I don't have the fla for fileUpload.swf to make sure the swf is passing back slashes.
taylor
We can use escape(Expression:String) to url-encode the url being passed to upload.cfm from the fileUpload.swf.
I know you are busy and am greatful for what you have done. Thanks
Divjak V.
big poz from me for everybody, exceptionaly for Laura..
great app.
I have one comment on whole thing,
and that is Execution Time.
It is just enormous, it kills the CPU,
typical bothleneck. I think this app can't be used for public open site. Yet, Maybe I'm wrong..problem is in cfform generation..I'm just mentioning this, because I'm looking for solution (: and working on one too, str8 flash, with CF integration..
let me know (:
poz
ob1
Matevz
(This really is a great app!)
Only thing i have problem with it is running it on multiple websites on same IIS (IIS 6.0 - Win2k3 sp1). On Default website it works fine, but it doesn't work on any other website I create - it just wont load. And on my production server i get same error as Todd described earlier (this is when calling application from default website, and when i call it through another Virtual Website (for the domain name) it doesn't even load - showing me JavaScript error in IE).
Any ideas?
Matevz
Figured it out couple of minutes after adding the post. The thing is: application requires access to /CFIDE/scripts - where the cfform scripts reside. So one way is to create virtual directory for every site that points to wwwroot\CFIDE (but i didn't like this solution) so i just copied the whole CFIDE/scripts to my webroot (note you must create CFIDE folder and within it scripts subfolder with contents from the original wwwroot\cfide\scripts
Thanks again for the excellent file manager Laura ;)
Newtotheforum
Great piece of work. I am looking for this app for Flex2 and CF. Are you porting this anytime soon? Has anyone any ideas where I can find this for Flex2 please?
Thx.
Michael Sandoz
MaxD
Love this application. I'm able to get it working fine (save for the Mac upload issue you've already acknowledged). I wonder if you could give a hint about including the file explorer in a pre-existing design? I've been trying to call it with:
<cfset GetPageContext().Include( "/fileexplorer/index.cfm" ) />
But that just returns a blank screen.
Thanks for any help you can give.
Pinki
Viktor
Here is solution for uploading files into subfolders for Mac.
1. Change upload function in index.cfm as follows:
public function upload():Void
{
path = 'upload.cfm?path=' + directories.selectedNode.getProperty('Path').split("\\").join(":::") + "&" + FileExplorer.sessionVars;
uploadSwf.upload(path);
}
2. Change upload.cfm to:
<cfif structkeyexists(form,"Filedata")>
<cfset session.fileManager.uploadFile("Filedata", Replace(url.path, ":::", "\", "All"), form.filename)/>
</cfif>
Cheers, Viktor.
vicky rifluxyss
vicky rifluxyss
I need your help, when include pages in my webpage. In the pagesource i was seen lots of spaces. I checked these spaces are lie after the <cfinclude> tags. Anybody help?
techie
I have this application and is working in localhost (thanks! \o/). But when i uploaded it online i get this blank white page (with title "ASF File Explorer" though). So, anybody help me what to do.
Here's what i did...
I created a directory /fileexplorer in mydomain.com
Put all the files in /fileexplorer
Edit and re-upload fileexplorer.ini
rootDirectory=e:\web\mydomain.com\fileexplorer
note: e:\web\mydomain.com is the web root dir of my hosting provider (ColdFusion 8)
www.mydomain.com/fileexplorer/ gives me a blank page.
Please help me. Thanks alot. :)
Douglas
I have been able to install it fine and I can upload a file and it comes into the directory. However, it won't show me the list of files and won't give me the directories.
All I get is a red box that reads "Event Handler Exception", which I can see comes from the responseHandler.onStatus from the setUpRemoting() on the index.cfm page. I can not figure out how to debug this problem. Any ideas?
Kevin Maloy
I have several sites that I was using this file explorer on however it appears that the application remembers the last root directory from the ini file. Is there a way to make it forget when you go to a new instance of the application?
Kevin Maloy
In the application.cfc you need to change around line 10 the line that reads: this.name = "ASF_FileExplorer" to this.name = "[ENTER YOUR UNIQUE NAME HERE]".
Dustin
Dustin
Airton Toyansk
I need your help... I need to use part of application, just the upload/datagrid side. Because I need to create the directories automatically (and, to do this, I used the CFTOKEN session variable). So, I need to select only the code that execute the files list in the datagrid (at the same time you uploaded these files).
Is there any article that describes something like this?
Or any idea?
Cheers!
Tim Miller
Uploading files required Flash Player 8
Please download it from Adobe
It's because the checkVersion function is setup for single digit versions. Version 10 was being reported as version 1. I upgraded the checkVersion function to the code below and it is happy again.
public function checkVersion():Void
{
var requiredVersion = 8;
var version = getVersion();
var flash_ver = version.split(" ");
var flashMajVer = flash_ver[1].split(",");
if (flashMajVer < requiredVersion) {
var msg = '<p>Uploading files requires Flash Player 8 <br><font color="#0000ff"><a href="http://www.macromedia.com/go/getflashplayer8">Please download it from Adobe</a></font></p>'
var alertSettings:Object = {title:'Warning', message: msg, width:200, headerHeight:27 }
errorpopup = mx.managers.PopUpManager.createPopUp(this, FormErrorException, true, alertSettings);
errorpopup.centerPopUp(this);
}
}
Rob
Maybe you can help me with where to turn off the folder renaming ability and with a little bug that I cannot find a fix for.
To allow my users "read-only" access (maybe you could add this functionality in a future release), I have added a session variable (boolean) that disables the delete buttons and changes the selectmode="EDIT" to "BROWSE". The bug occurs when the CFGRID selectmode is set to anything other than EDIT and a user selects a file to download and they click CANCEL instead of OPEN or SAVE. Once the dialog box closes and the user clicks on another file, an error message appears reading "Internet Explorer cannot download . Unspecified error". If I select OPEN or SAVE, everything is dandy. Any ideas?
Also, where can I disable the ability to edit the folders?
Keep up the great work!
Tim MIller
directories.editable = true;
I actually check a database when a user changes folders and set this value based on whether or not the current user has rights to the selected folder.
From what I have found, to fix the IE download error you have to open the download.cfm page in a new window. The page is only open to serve the content, it closes immediately when the user selects an action. That intermediary page doesn't even really show in other browsers. If anyone has a better suggestion, I'd love to hear it.
In the downloadFile() function add an _blank target page to the getURL call:
getURL('download.cfm?path=' + path + "&filename=" + name, '_blank');
Rob
Thanks again!
Tim Miller
Windows, but I ran into something interesting today and thought I would post it. The problem was
that the tree items were just not showing up at all. The tree was just empty. I had some code to
open the root folder when the form is loaded (I'll include that as well) that I modified slightly
and was able to fix the issue. I'd love to hear if someone has some better ideas.
First, add the following to the end of the formOnLoad function. Basically we're listening for the
form to truly finish loading (creationComplete). At that point you have to wait for at least
another like 80ms before calling the openRootNode function. If you don't wait the extra time it
just won't work...at least work reliably. I let mine wait about a full second before it
continues. I know, it's odd, but I haven't been able to track that one down.
//Event listener for form load completion.
var loadListener = {};
loadListener.creationComplete = function():Void{
//Delay call to openRootNode().
_global.setTimeout(_root.openRootNode, 1000);
}
this.addEventListener('creationComplete', loadListener);
Here's the openRootNode function. I put mine right after the close of the formOnLoad function.
public function openRootNode():Void {
var directories = directories;
var firstNode = directories.getTreeNodeAt(0);
//Add root node.
if(firstNode == null){
<cfoutput>
directories.addTreeNode('#treeRootLabel#', '');
directories.getTreeNodeAt(0).addTreeNode('Getting sub-directories...',
'');
</cfoutput>
//Reset firstNode var.
firstNode = directories.getTreeNodeAt(0);
}
//Select root node.
directories.selectedNode = firstNode;
//Open root node.
directories.setIsOpen(firstNode, true);
//Get sub-directories and files.
_root.verifyRoot();
_root.getDirs(directories.selectedNode.getProperty('Path'));
_root.getFiles(directories.selectedNode.getProperty('Path'));
}
Paul Squance
I am appending a sub directory to the rootDir variable during session start.
<cfset rootDir = "" />
<cfset varSubDir = "" />
<cfset rootDir = GetProfileString(variables.config, "default", "rootDirectory") />
<!--- This works: <cfset varSubDir = "2000" />--->
<!--- This does not ! --->
<cfset varSubDir = "#url.dmr#"/>
<!-------------------->
<cfset varSubDir = varSubDir.ToString()/>
<cfset rootDir = rootDir.concat(varSubDir) />
<cfoutput>#rootDir#</cfoutput>
The final rootDir via either specification when output is correct. However, when the string varSubDir is used File explorer processes correctly. When the URL parameter varSubDir is used there is an Event handler exception, which must be a Java error response. However, the Java.IO does take the the initial rootDir correctly. The event handler seems to fail during the openRootNode function.
If anybody can provide any input, it would be much appreciated.