Our Blog

file explorerThis 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:

ASF File Explorer information

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 ;)

Laura

Laura

151 Comments

  1. John  Barrett
    Hi,
    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
  2. Willem
    Hi
    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?
  3. Neil
    As usual, BEAUTIFUL work... I was nervous that maybe you guys just...quit :)

    Any plans to make any of the available features permissions dependant?
  4. 6dust
    Looks great! Installed it locally and ran into an odd situation, though. If I try an upload some files, either multiple or one at a time, a subfolder gets created with each filename, and then in those folders are the files. That's not how it's supposed to function, is it? Aren't they just supposed to upload into the current directory?
  5. Laura
    Thank you all.

    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.
  6. Laura
    John,
    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.
  7. 6dust
    Thanks Laura! I installed the hotfix just to avoid future issues; problem solved!
  8. John  Barrett
    Hi Laura,
    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
  9. Tony
    Are you able to move files around between directories?
  10. Vincent

    Vincent

    John,

    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
  11. David Brannan
    Sweet - you guys do the best work!

    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.
  12. Laura
    Tony,
    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.
  13. David Brannan
    Laura,

    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.




  14. thinman

    thinman

    Odd Error:

    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")) />
  15. Kirk Mower
    This is a great app. My only problem is that I want to use it on a remotely hosted site and as such they can set up a mapping for me, but I don't have access to the web root for obvious reasons. Is there any way to get this to work without access to root ? Thanks a lot and great work.
  16. Laura
    David,
    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.
  17. Doug
    I am trying to check this. I tried to change some of my directory setting and they will not update. It appears there is some serious caching going on. Is there anyway to delete it? Thanks!
  18. Doug Bedient

    Doug Bedient

    Scratch that. I figured out how to delete the application variables. Cool stuff. There's always too much to learn.
  19. Anastasios
    Laura,
    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
  20. Neil Huyton

    Neil Huyton

    Hi.
    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 &quot;500 null&quot; error.

    Any ideas why? Is it becasue it's a large file?

    Thanks
  21. Jeremy
    I just found this tool and it looks awsome. However, I cant get it to work. I keep getting this error.

    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 --->
  22. Laura
    Neil,
    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
  23. Tim
    Laura,
    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]
  24. Roger
    Wonderful app!

    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
  25. Randy
    Ok,

    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,


  26. Laura
    Roger,
    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.
  27. 6dust
    Hi Laura,

    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!
  28. Neil
    6dust:
    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.
  29. 6dust
    Hi Laura,

    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!
  30. 6dust
    Whoops, sorry for that repeat post. Wasn't expecting refresh to have that affect.

    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
  31. dan
    Yes im having trouble getting it to locate the folder that im trying to view. I have edit the INI file to point to this \inetpub\wwwroot\cneworks\wwwroot\ my fileexplorer folder is in the wwwroot folder on the end and i want it to browse just are uploads folder any help would be great.
  32. Laura
    dan,
    you need to specify the absolute path of the folder you want to explore. ie: C:\inetpub\wwwroot\cneworks\wwwroot\someDir\otherDir
  33. Very Cool Guys. I have a solution very similar over here. However, my issue is how to download multiple files at once. For example, I generate a group of XML files, but don't want to have to zip them and have the user unzip them... is there an easy way to get these files to the client's machine? Without asking for save confirmation over and over again...?
  34. Good news!
    the mentioned project &quot;floe&quot; was released today. i´ve already downloaded and installed it and it´s really cool.

    Here´s the link... http://www.unic8.com
  35. Noel
    Hmmm.. Here we go again!

    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?
  36. Laura
    Noel,
    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)?
  37. Noel
    Laura,

    re: com folder..
    If you are talking about the &quot;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
  38. Wally
    I am getting this error when trying to execute the original application: &quot;Element COMPONENTPATH is undefined in REQUEST. &quot; on line 80 of the index.cfm.

    Have I missed something for the installation?
  39. Noel
    Hmm ok..

    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...
  40. Laura
    Wally,
    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
  41. Kevin
    First off, this is a great tool! Thanks for taking the time create it!!

    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 &quot;getting sub directories&quot; 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!!

  42. Noel
    Laura,

    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.
  43. Noel
    Is it just me?? When I downloaded a .gif or .jpg, with ASF File Explorer they do not work anymore (the image is damaged)
    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?
  44. 6dust
    Noel: Might this be because you have the DevNet version of CF? If you view the source of any other CF page, is there a META tag at the top saying something about DevNet? If so, that's the problem. That tag is put on EVERY output that comes from CF, including these images, which would corrupt them.
  45. Noel
    6dust.. No I've got the paid Standard Edition here.. No META tag at the top saying anything about DevNet! :-)
  46. Marilyn

    Marilyn

    As everyone agrees - great code, thanks for your efforts.

    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
  47. Laura
    Noel,
    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)
  48. Marilyn

    Marilyn

    Thanks Laura,
    Found the problem right after the post naturally. Pays to update on a regular basis. Downloaded the coldfusion updater. Goodnight.
  49. Felipe
    Im very anxious to get this program working but continue to get this error. Does anyone have any idea what setting I need to modify.

    Thank you

    Felipe


    Attribute validation error for tag CFFORMITEM.
    The value of the attribute TYPE, which is currently &quot;script&quot;, must be one of the values: HRULE,HTML,TEXT,VRULE,SPACER.
  50. Neil
    Hi Felipe.

    It looks like you don't have Coldfusion 7.01 installed.
    The 'script' item isn't supported in CFMX 7.00.

    Thanks,

    Neil
  51. Felipe
    Thanks for the quick reply it seemed that work.

    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
  52. Kevin
    Laura...

    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
  53. John Farrar
    I was wondering if there is a way to include a flash movie (like you do inside of flash for including a nested movie)...? I noticed this file had a couple of swf files in it and thought perhaps this is something you were doing.
  54. Thomary

    Thomary

    I would like to purchase an Amazon gift certificate to Thank you all for the help you've provided me. It seems I need your email address. I have never used Amazon before, so maybe I'm wrong. Or maybe you could add gift certificates to your wish list?
  55. Laura
    Kevin,
    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!
  56. Tom
    Laura - This is a great little ap! I just have one small issue. I can create folders just fine, and i can upload to my main folder no problem. However if I try to upload to a sub directory nothing happens. I click the 'upload' button but it doenst do anything. It's very strange. Like i said, if I select the root directory and hit 'upload' it all goes fine. I feel like it's some simple setting that im missing but i just cant think of.

    TOM
  57. Tom
    More wierdness. 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. VERY wierd.
  58. Ed Welch

    Ed Welch

    does anyone know how to create a AS countdown timer to refresh a grid in a cf flash form? I want to refresh the contents of a grid without refreshing the entire cfm page.

    Thanks
    Ed
  59. Aaron
    Awesome stuff here, you guys are probably my favorite blog. I was wondering if the cfinput tag has something similar to the onblur event in javascript. I am trying to pass dynamically generated text field variables to actionscript so they can be passed to a CFC. I dont want to take up too much space here, so if anyone has an idea or needs to see the code I will post it on my blog and link as needed. Thanks in advance to everyone for the input.

    --Aaron
  60. Neil
    Arron,

    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....
  61. Aaron
    Neil,

    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.
  62. Aaron
    Sorry forgot to add the the onchange wont work because it fires at every change. I need to pass either a list or an array of text field values to actionscript.

    --Aaron
  63. Neil
    Aaron,

    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.
  64. C
    This works great. However, I tried resizing the screen using firefox on a pc and it has shifted the right pane down. I did this with safari on Tiger and the right pane completed disappeared. Any way of preventing the shift? The only way I could think of was to make a javascript call to open this app and code it for no resize ability.
  65. C
    Oops. I didn't see those 3 comments about the resizing.

    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!
  66. Aaron
    Neil,

    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
  67. Aaron
    Neil,

    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
  68. Neil
    you want to pass the field NAME to a cfc? wow.... ummm, I would probably have a hidden text field that contained a comma delimited list w/ all of the field names.

    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 &quot;knowing when the form data arrives&quot; 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
  69. Aaron
    Neil,

    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
  70. TOM
    Anyone else having a problem with this running in Safari or Firefox on OSX? I can upload to the main directory from these browsers, but no sub directories. It works fine on PC .. which has me completely confobulated.. . .

    Any help would be great..

    TK
  71. John Barrett
    Hi Tom,

    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
  72. TOM
    I should have clarified, The files are running on a PC server, but when i access them from a Mac browser is where i run into wierdness. I can upload to the Main folder, but cannot upload to subfolders at all. It just sits there and does nothing. However, when I browse to the same page on a PC i can upload fine. I should note I am running the website on IIS not Apache.. would that make a difference? It's very odd, and if my wife didnt insist on using her Mac it wouldnt matter in the least to me.

    TK
  73. Lachie
    Love the app!

    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 &quot;getting directories&quot; and never actually loads them.

    Any thoughts?

    Kind Regards

    Lachie
  74. John Barrett
    Hi Tom,
    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:(
  75. Tjoolder
    First I would like to say that this is a very cool app! Keep up the good work!
    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!
  76. Poolio
    I am trying to create an app which uses the cfdirectory explorer functionality of the fileexplorer app but also enables users to check the files they want and save them to the database. Similar to a big email attachment area. The problem I am having is that it does not pass values of the files in from the grid to an action page. Any ideas?
  77. Tom S.
    Regarding the SSL (https) sites, I was receiving the &quot;not of the binary AMF protocol&quot; error in my flash.log, and couldn't figure it out. Tested the CFC, it worked, looked at my gateway config XMLs, etc., and it turned out to be the function setUpRemoting(); the connection has http hardcoded, and after changing to https, everything was great. Just thought someone might benefit.
  78. BM
    Thanks for a great app! Unfortunately, I'm having difficulty when attempting to run this from within another directory in another app.

    When I attempt to expand the dir tree, I get the following error: &quot;Service fileexplorer.services.fileExplorer not found.&quot;

    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.
  79. Bm
    Never mind - solved the problem. I hard coded the path in the setUpRemoting() function.

    But I would still like to know aboutbthe multiple dir ...?

    Thanks.
  80. Laura
    BM,
    When you make changes to the ini file, make sure you refresh the application by changing its name, restarting CF or running onApplicationStart().
  81. When I attempt to expand the dir tree, I get &quot;Service fileexplorer.services.fileExplorer not found.&quot;

    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?
  82. TW
    I downloaded ASF File and put it in the web root directory; I change the root Directory and tree Root Label in the fileexplorer.ini file. The flash form comes up fine, but when you click on the directory I get this error; Service fileexplorer.services.fileExplorer not found. The error changes when you change the service path. I have tried to following combination

    ;---- servicesPath -----
    ;the path from your web root to the services directory

    servicesPath=services

    servicesPath=fileexplorer.services.fileexplorer

    servicesPath= fileexplorer.services

    Anyone have any Ideas?
  83. Larry
    This is a wonderful application.

    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.
  84. Laura
    Keith,
    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.
  85. Thomas Moore
    what about this error:

    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>
  86. Laura
    Thomas,
    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.
  87. capcomms

    capcomms

    As Tjoolder asked a few weeks ago, how big a problem is the 100Mb limit? I need something like this for a Digital Asset Management system and will need to handle assets of up to 1gb in size.

    Regards

    </cliff>
  88. James W.

    James W.

    <p>This is exactly what I need, but I don't have much experience with Flash Forms. I want to incorporate this into one of my websites, but like I said, I'm not sure how this works. I wanted to know if you have any documentation about using this code, or even if you can give me some of the basics about calling these CFCs inside of Flash Form. I apologize in advance if this question is too basic.</p>
  89. James W.

    James W.

    One other thing, can I use this code as part of form that uses a POST method to pass other values in addition to the uploaded file information? I saw something in the fileupload explained tutorial that made me think that only the file(s) upload would be the only values that could get passed from the form.

    Thanks
  90. Tim V.
    Fantastic App! Thanks for the splendid effort! Works great for me with the following exceptions:

    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
  91. Tim V.
    Oh and one more thing that I forgot. When I try to delete a file I get a message saying: "ColdFusion could not delete the file "C:\Data\Webs\Engineering\test\i1040.pdf" for an unknown reason"

    Okay - that's all - hope you can help. Thanks again.
  92. Laura
    capcomms,
    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.
  93. Tim V.
    Hi Laura,

    You were right - it was permissions. When I changed the folder permissions everything worked. Thanks again for a terrific product and great support!

    Tim
  94. Chad Wagner
    Tom, I have EXACTLY THE SAME ISSUE. My clients can upload on a MAC to the root directory only, and not to any sub-directories. I have tried the ASF file upload that comes as a standalone and it works great on a mac, but for some reason when they load it into the ASF file explorer, the MAC compatability is lost. What the heck???
  95. Tom
    Chad - THANK YOU! I was begining to think i was crazy! I still havn't figured it out. I in fact gave up on it for a while. Here's hoping that with anohter person having the same issue someone will look into it!
  96. Todd
    Hi Laura,

    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?
  97. Roger
    My web hosting doesnt allow for CFDIRECTORY. Is it possible for the ASP File Explorer to work without it enabled?

    roger
  98. Laura
    Todd,
    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.
  99. Will
    Laura, I used a version of your code to download a file in my own code. The code was from your download.cfm. Your code is <cfheader name="Content-Disposition" value='attachment; filename="#url.filename#"'>
    <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
  100. Ed
    i have setup the app and it works well except the upload...I get the "MS Windows connect to" screen asking for username and password on Win XP and I have added this information and nothing happens...the upload progress states 100% successful but no file in the folder...any ideas?
  101. Laura
    Will,
    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.
  102. George
    I have been trying and trying to add a Session.userid. The session gets created on the index page and looks like: Corp or Sales or Images (basicaly the folder names that are already on my server). I change the name each time I try to start fresh most of the time I get errors like mentioned above. Cant find method getDirectory , Java.Lang not found etc. What exactaly do I need to change? I changed the fileexploer.ini to "session" I enabled sessions in an Application.cfm page. Lastly added & #session.userid# to the end of line 64 in the Application.cfc just like the example. What else could I be doing wrong? Thanks Great work
  103. Conrad
    Excellent App !!!!

    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>
  104. frank
    Cracker app!

    One thing - is it possible to select multiple files to download?
    Anyone modified this to select multiple files to download?

    Thanks
  105. Leo
    I got it to work beautifully on my local server. Howver, I get this error message when I upload to my hosting server.

    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;
  106. George
    I have this working great. I made a stripped down version that does not let you upload delete or add. Just select a folder and then a file and download it. The last thing I cant fugure out if how to stop someone from changing the folder names. I would think there would be a command like: select="no" but I dont see that. Can anyone help me
    Thanks
  107. Laura
    Leo,
    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;
  108. Chris Pettigrew

    Chris Pettigrew

    Is it possible to open the root directory on the onload event of the page or a way of creating the same effect.
  109. Dan Fredericks

    Dan Fredericks

    has anyone created a multiple file upload function yet? that would be a great feature and was talked about somewhere above...maybe i just missed it.
  110. Glen20

    Glen20

    Hi Laura,
    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.
  111. Ken Mun

    Ken Mun

    Hi Laura,

    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 ..
  112. John
    Anyone notice that sorting files by "Last Modified" increments the file times?
  113. Ernie Pena

    Ernie Pena

    Anyone have a clue as to what is causing this error?
    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.
  114. Wender
    Hi all!!
    i read the code any times but i can't understand one little think...
    how can i to determine multiple file selection at once?
  115. Vu
    Has anyone had an issue of the GUI loads perfectly but it is getting hung up on displaying the folder tree? no errors and the flash template loads fine; what could I check for?

    Thanks
  116. Laura
    Vu,
    I would check whether Remoting is working fine in your server. Do other Flash forms load data?
  117. Jason Lim

    Jason Lim

    I have a problem running it as well on 7.0.2, previously was all good before the update.

    Anyone know what's wrong?
  118. taylor
    Tom, Chad

    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.
  119. Laura
    taylor,
    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.
  120. taylor
    Wow, thanks for the quick response and I'm glad you know what I'm talking about.

    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.
  121. taylor
    Here is another thing that my friend pointed out.

    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
  122. Divjak V.
    hello..(:
    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
  123. Matevz

    Matevz

    Hi,

    (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?
  124. Matevz

    Matevz

    Ahhhhh nevermind :)

    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 ;)
  125. Newtotheforum

    Newtotheforum

    Hi
    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.
  126. MaxD
    Laura-

    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.
  127. Pinki
    I am trying to run this application but it does not show up anything. Please help me with that
  128. Viktor
    Hey guys,

    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.
  129. vicky rifluxyss

    vicky rifluxyss

    Hi guys,

    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?
  130. techie
    Hello guys,

    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. :)
  131. Douglas

    Douglas

    I see that nobody has commented in a long time, but hopefully someone still will.

    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?
  132. Kevin Maloy
    Laura,

    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?
  133. Kevin Maloy
    I have found the answer to my own question, so here it is for other users.

    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]".
  134. Dustin

    Dustin

    I cannot seem to get this to upload. My server (CrystalTech.com) uses an FTP server that does not permit the COM folder to be created. Has anyone ever heard of this? and is there a way around that?
  135. Dustin

    Dustin

    Nevermind... Apparently I jumped the gun too soon. I discovered on their site that this is not a "security feature" but rather a glitch. Maybe someday I can get this to work.
  136. Airton Toyansk

    Airton Toyansk

    Hello guys,

    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!
  137. Tim Miller

    Tim Miller

    With Flash 10 now out I started receiving the following error:

    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);
             }
          }
  138. Rob
    This app is exactly what I was looking for in my Intranet. I am very impressed with the concept of scripting and the flash cfform (yes, I have been living in a cave).

    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!
  139. Tim MIller

    Tim MIller

    To turn off the ability to edit directory names find the following line in the formOnLoad() function and set the value to false:

    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');
  140. Rob
    Thank you Tim Miller! Everything you gave me was perfect and now the app has been moved into production.

    Thanks again!
  141. Tim Miller

    Tim Miller

    I don't know if anyone else is trying to support this thing on Google Chrome, or Safari on

    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'));
    }
  142. Paul Squance
    I'm sure I'm being lazy but I am running out of time to resolve a problem.

    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.

So, what do you think ?

Subscribe to this comment thread
Leave this field empty