Get only the filename not the full path of the file.

hi to all..
how can i get only the filename of the file not the full path and to be placed on a textinput.?
example:
when i'browse the file and select sample.txt
"C:\Users\user\Desktop\folders\sample.txt" this will be inputted on the textinput.
however, what i want to have is when i'browse and select a file..
textinput should only contain "sample".
does anyone knows how to do it?

Hi cyrus@adobe,
How are you getting the full path of the file when you browse, I dont think for security reasons the Flash Player will aloow to do so. You can only get the file name not the full path of the file when you browse.
Are you using Flex4..?? I am not sure whether this is possible in Flex4..However if you are getting full path and if you wanted to show only the filename then you can just use theString class split function to acehive this..
var fullPath:String = "C:\Users\user\Desktop\folders\sample.txt";
    var splitPath:Array = fullPath.split("\");
    textInput.text = splitPath[splitPath.length-1];
Thanks,
Bhasker

Similar Messages

  • Home to get only the file name ?

    I m trying to get only the filnames without the path
    if( myDir.exists() && myDir.isDirectory()){
                  File[] files = myDir.listFiles();
                       for(int i=0; i < files.length; i++){
                            if (files.getName().indexOf(".xml") == -1)
                             continue;
                        System.out.println(files[i]);

    You answered your question
    files.getName().                                                                                                                                                                                                       

  • How to get only the graphics path without graphics names?

    Hi All,
    I need to get only the graphics path without graphics names like 'd:\Images\' instead of 'd:\Images\abc.jpg' in JS.
    Thanks,
    Praveen

    Something like this should get you close…
    #target indesign
    function main() {
         if (app.documents.length == 0) {
              alert('Please have an "Indesign" document before running this script.');
         return;
         docRef = app.activeDocument;
         with(docRef) {
              var x = rectangles[0].allGraphics[0].itemLink.filePath;
              var y = new File(x).parent.fsName;
              $.writeln(y);
    main();

  • Get only the rows where there are no matches in the tables

    To include in the results of a join with no matching rows, you can use a full outer join. In MS SQL Server provides the FULL OUTER JOIN operator, which allows you to include all rows from both tables, regardless of the presence or absence of values.
    You can add a WHERE clause in a FULL OUTER JOIN to get only the rows where there are no matches in the tables. The following query returns only those products for which there are no matches in the sales order.
    SELECT p1.Name, p2.SalesOrderID
    FROM  TAB1 p1
    FULL OUTER JOIN TAB2 p2
    ON p1.ProductID = p2.ProductID
    WHERE p1.ProductID IS NULL
    ORDER BY p.Name ;
    FULL OUTER JOIN is not supported in ABAP.  How can you solve this?
    Thanks in advance,
    Serena

    Similar problems can often be solved by using subqueries, please have a look here and try applying it.
    http://help.sap.com/abapdocu_702/en/abenwhere_logexp_subquery.htm
    Thomas

  • 7th gen nano syncs only certain songs, not my full library.  Ipad and old nano sync fine.  How do I get 500 songs v. 63?

    7th gen nano syncs only certain songs, not my full library.  Ipad and old nano sync fine.  How do I get 500 songs v. 63?

    **1. Separate these out first without deleting anything from i tunes libary?**
    iTunes:
    Set up 2 iTunes playlist, one for songs & the other for talking books.
    **2. Then simply transfer my 500 odd tracks of music to my new nano?**
    Connect new iPod to computer & set it to manually sync.
    Move your music playlist to Devices. Music will sync to your new iPod.
    *3. Once all this done, delete songs (only) from the old nano just leaving my talking books?
    Connect old nano to computer.
    Under Devices-Music: Start deleting all the songs including any song headings you have in the left column under Music. This will delete from the iPod yet leave your iTunes library intact.
    Read the iPod nano (5th generation) - User Guide for other suggestions.

  • How can I get only the music I want onto my iPhone using iTunes Match

    how can I get only the music I want onto my iPhone using iTunes Match?  At present it is putting a random selection on; it has none of the same control as iTunes on my Mac.  And although I uploaded all my album artwork to iCloud, it is not transferring it back to my iPhone

    Iphone are meant to be sync to one itunes library only.
    You can copy those songs to a cd and then put a copy to your itunes media library.

  • Get Only the direct children by name

    Hello all!
    Is there a way in JAXP to get only the direct children by name, as oppose to Element.getElementsByTagName(String name) that returns all the children with the given name of all descendant (not just of this one).
    Thanks in advance,
    Alon.

    The JAXP API doesn't define a method for this. You can implement your own quite easily:public Vector getChildrenByTagName(Node parent, String name){
      NodeList children = parent.getChildNodes();
      Vector childMatches = new Vector();
      Node child;
      for(int i=0; i<children.getLength(); i++){
        child = children.item(i);
        if((child.getNodeType() == Node.ELEMENT_NODE) && ((Element)child).getTagName().equals(name)) childMatches.add(child);
      return childMatches;
    }

  • To get only the error messages???

    Hi,
    When i compile my java code i am getting warning errors also . Is there anyway to get only the error messages only, not the warning using
    javac or java???
    Thanks,
    JavaCrazyLover

    javac <option> <sourcefile>. if you use[b] -nowarn option you get only error message.
    if in the shell invoke only the command javac without option and sourcefile you see all option available. Bye

  • How to get only the CD ROM / DVD ROM units

    Hy to everybody,
    I have a little problem and i hope someone could help me.
    The problem is like this i've whant to list all the CD/DVD units, not all the units.
    For exemple if i have C: D: E: G: and C: and D: are hdd and E: it's a CD unit and G: it's a DVD unit i whant to get only D: and G: .
    I've tried with File.listRoots().
    but this gives me all the units. It's there a way to specify the type of the units i whant to get?
    Thanks for your help.

    Some systems can mount a file system against a file containing an iso image.
    Does such a file system qualify as a CD/DVD unit or not?
    If a CD/DVD drive is shared by another box and it is being accessed as a network drive, does it qualify as a CD/DVD unit?

  • How to get only the selected layer data?

    Hi All,
              I'm using dissolve sample plugin. I added two layers in photoshop both of different dimensions, say 1000 * 1000 & 2000 * 2000. Now I select the layer with 1000 * 1000 dimension and click on Dissolve plugin. The preview image what is shown in dissolve plugin dialog is not just the selected layer, but also some extra pixels around the selected layer.
    Do I need to set any flag for getting only selected layer data to display in preview?
    Also I need to get only the selected area in a particular layer. When I checked FilterRecordPtr, haveMask flag is TRUE if the part of the layer is selected. But how do I get only the part of the layer that is selected for displaying preview image?
    Please let me know if the description is not clear.
    Thanks,
    Dheeraj

    Thanks Tom Ruark for the response.
    That is exactly the same thing what I'm seeing.
    1.Is there a direct way to know the bounds of the layer without the transparency grid so that I can show only the layer?
    2. If I select an area of 50*50 within a layer(1000*1000) using Rectangular Marquee tool, then I want only that selected area to be shown in preview. For this there is a haveMask flag which indicates whether or not there is selection, but the selected bounds are not available. I'm currently calculating the bounds. I just wanted to know if Photoshop SDK has any field for getting the bounds?

  • How to get only the date without the time in the footer of a printout?

    Is there a way to get only the date without the time in the footer of a printout?

    As far as I can tell, there's no built-in option to get the date printed without the time. It's hardcoded in a C++ file.
    As a workaround, you can enter custom text for the footer, but it would need to be updated every time the date changed. I can think of a couple ways to automate that:
    * An add-on (but I'm not aware of any add-on for this)
    * External process to push a new date into prefs.js, a settings file that stores your header/footer preferences, among others (but Firefox should be closed when you update this file, and it will be read when you restart)
    Not easy enough, I know.

  • How can I get only the last 2 rows?

    How can I narrow down a query to get only the last two rows in a table ?
    Thanks,
    Mohan

    Thanks a lot Ram for your suggestion but already I have a query which returns a set of rows, of which I would like to further filter and get the last two rows
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Ramanuj Bangad ([email protected]):
    try out something like this if it helps.
    Example:
    select * from users
    where rownum <= (select count(*) from users)
    minus
    select * from users
    where rownum <= (select count(*) -2 from users )
    <HR></BLOCKQUOTE>
    null

  • Hello everyone. As a new Mac user, I would really like to know the easiest way to move my music files from my old PC to my MacBook? Do I move only the files, the entire iTunes and how? I have a lot of music so it is not a solution with iPod/iPhone.

    Hello everyone. As a new Mac user, I would really like to know the easiest way to move my music files from my old PC to my MacBook? Do I move only the files, the entire iTunes and how? I have a lot of music so it is not a solution with iPod/iPhone.

    Your best option is to post this in the iTunes forum.
    Ciao.

  • I get message "the file could not be edited because Adobe Photoshop CS5 could not be launched."  "S

    I get message "the file could not be edited because Adobe Photoshop CS5 could not be launched."  "Some of the application components are missing from the application directory.  Please reinstall the application."
    I have reinstalled from my disk three times but still get these messages!  How do I correct this problem?

    Reply to Trevor Dennis:
    I am a long-time user, back to Photoshop 6.  I have a Mac Pro running OS X 10.7.5 (Lion).  I have tried to reboot and then reinstall but I keep getting the same message, that there are components missing from the appl;ication directory.  The program worked well this past week so this is a new problem.  As it is CS 5 I can't get much help from Adobe.

  • How to get only the first level of nodes for a subform?

    How can we get only the first level of nodes of a subform?
    For ex:
    Form1
         SubForm1
              Text1
              Text2
              RadioButton1
         SubForm2
              Text1
              Text2
              RadioButton1
         SubForm3
              Text1
              Text2
                   SubForm31
                        RadioButton1
    In this heirarchy if we give Form1.nodes will refer to all nodes under the Form1 (SubForm1,Test1,Text2,RadioButton1,SubForm2,...SubForm31, RadioButton1 etc..)
    But is there any way that we can access only the first level of nodes of Form1 ie can we get only (SubForm1,SubForm2,SubForm3) for Form1 in any Way..?
    Thanks.

    Two ways .....
    1. Use Javascript E4X instead ...there are nice functions for getting children of parents.
    2. Cycle through all of the form1.nodes and look for objects that have a className of "subform". For loops are useful for this task.
    Make sense?
    Paul

Maybe you are looking for

  • How to use relative pathnames in a webb application?

    We have made a webb application with Netbeans. It was developed on Windows, but will be deployed on Linux. In the application, a file is created from the pathname C:/Documents and Settings/xeyvalm/CRMtester/res/parameters.txt. I want to avoid the har

  • Can I connect my ipad2 to a projector

    Hi.. I'm wanting to use my mind application for presentation I have to give... I would like to know if I can connect my iPad2 to a projector if so how.. Thanks

  • HT201317 How to reset "new" message?

    When a new photo appears on a Photo Stream I'm subscribed to the 1 New, 2, New, etc. message remains even after I've viewed all the photos. How do I reset the "New" message once I've viewed all the current photos on a particular stream?

  • Please Help - Original iMac 333mhz (purple)

    Here's the story. A friend of mine knows a little boy whose parents passed away and they want to give him a computer for Christmas... she asks me where she can buy a cheap used one and I offer her my purple iMac. I pull it out, plug it in and turn it

  • Error Creatu00EDng Consumer Proxy

    Hi, I am currently trying to create a consumer proxy from an simple free web service. The used WSDL can be downloaded there: [http://www.thomas-bayer.com/axis2/services/BLZService?wsdl] After doing the diffrent steps of the wizard ( "Select Source",