2 Replies Latest reply on Nov 28, 2009 4:19 AM by Matt Le Fevre

    create folder

    GeorgeWS Level 1

      I am building a file manager. Im using Flex 3 and CF8 I can do just about everything I want but create a folder. Is there a sample of how to have a textbox and make that build a folder on my server?

       

      Thanks

      George

        • 1. Re: create folder
          Gregory Lafrance Level 6

          In Flex/AIR, all you can do is communicate with the server. You'll need a server side script called via HTTPService to create the folder.

           

          If this post answers your question or helps, please mark it as such.


          Greg Lafrance
          www.ChikaraDev.com

          Flex Development and Support Services

          • 2. Re: create folder
            Matt Le Fevre Level 4

            GeorgeWS wrote:

             

            I am building a file manager. Im using Flex 3 and CF8 I can do just about everything I want but create a folder. Is there a sample of how to have a textbox and make that build a folder on my server?

             

            Thanks

            George

             

            Simple example using PHP:

            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
            
                <mx:HTTPService id="Makefolder" method="POST" result="trace('folderMade')" url="http://localhost/test.php">
                    <mx:request xmlns="">
                        <newFolderName>
                            {folderNameInput.text}
                        </newFolderName>
                    </mx:request>
                </mx:HTTPService>
                
                <mx:TextInput id="folderNameInput" x="313" y="249"/>
                <mx:Button x="357" y="279" label="Button" click="Makefolder.send()"/>
                
            </mx:Application>
            

             

            and test.php would look like:

             

            <?php
                $newFolderName = $_POST['newFolderName']; //get POSTed data from Flex
            
                mkdir($newFolderName, 0700); //make folder
            ?>