[JS CS3] Frontmost document/selection when other with same name?

I have a few scripts used to perform various operations on the current selection in InDesign. Under normal circumstances these work fine, but I can't seem to reliably get the frontmost document/selection when there is another document open with the same name. Most references to the document and every reference to the selection I have tried so far will simply lead to the document which was most recently opened (and has the same name).
app.activeDocument.fullName always return the path to the most recently opened document of the same name, but app.documents[0].fullName will return the correct path. Trying to get the selection though will always return the selection of the most recently opened document of the same name, regardless of whether I try app.selection, app.activeDocument.selection or app.documents[0].selection. I have also tried with getElements()[0] appended to the document reference but it makes no difference.
My primary environment is still CS3 and the problem appears to be that it only references documents by name. Brief testing with CS5 indicates this has been solved by Adobe, presumably because it now refers to documents using an id by default. Haven't tried CS4 but since its document object does not have an id property I'd assume it will behave the same as CS3. Is there any way around this, or is the best I can do to detect the issue (a simple app.activeDocument != app.documents[0] comparison seems to work reliably) and refuse to run if encountered?

Welll...chances are the selected item will not be a valid ID in both documents of the same name. (I don't think ID's are globally unique, so that's not a guarantee -- but it's something you can check and only give an error if it happens to be that there is a collison).
So, get the transaction specifier of the selection:
app.activeWindow.selection[0].toSpecifier()
Result: /document[@name="u1.indd"]//text-frame[@id=211]
Then, iterate over app.documents to find the indexes of the documents with that name.
In my test, of course it is just zero and one.
Then, try to resolve the specifiers against those documents:
resolve("/document[0]//text-frame[@id=211]")
Result: [object TextFrame]
resolve("/document[1]//text-frame[@id=211]")
Error: Object is invalid
Since only doc 0 has a textFrame with id 211, you know it's doc 0 and you have a valid specifier.
I chose to adjust the specifier by hand, because I think that's probably the most general. The other choice would be to call app.documents[0].textFrames.itemByID(211), but then you would need to map "text-frame" to "textFrames" and that seems annoying and errorprone.

Similar Messages

  • Select duplicate Data with same No.

    Dear All experts,
        How  we giong to select the data with same No as 1 record count.
    example :    Bellow is the sample table contains 5 rows records, but of records ard same number.
          post No.               Name
          1001                      Jacky
          1001                      Jimmy
          1002                      Mark
          1003                     Jin
          1004                     chloe
    when  i use the select statement bellow : 
    Select * from table into corresposding of table t_table up to  3. 
    will get the result  like below .
          1001                      Jacky
          1001                      Jimmy
          1002                      Mark
    Question is , how i going to write the statement  to get the 3(depend on user insert how many record)  different no.  example , 2records of 1001, 1002 , and 1003 .

    if its a ztable then better to keep a counter field for your requirement.
    else.
    parameter : count type i. "this holds number of required data.
    select * from TT_XYZ into table gt_itab.
    loop at gt_itab into gs_itab.
    at end of post_no.
       count = count - 1.
    endat.
    if count = 0.
      exit.
    endif.
    append gs_itab to gt_itab2.
    clear gs_itab.
    endloop.
    now gt_itab2 holds required entries for you.

  • Error while uploading document with same name in Document library

    Hi,
    Whenever I try to upload document with same name in Document library it throws an error. I know its a default behavior but is there any way so that I can upload documents with same name or can we append some unique id with title of the document?
    Please suggest.
    Thanks

    No, unfortunately this is not possible. SharePoint treats the file name as the primary key identifier for a document so if you try to upload a second document with the same name it will assume this is a new version of the file. If you have versioning enabled
    on the document library, it will add this as a new version. If not, it will overwrite the original file with the new one.
    If you need two documents with the same name, you will have to either place them in different folders within a document library or in different document libraries.
    http://stackoverflow.com/questions/11894968/uploading-documents-with-same-name-to-sharepoint-2010
    Regards,
    Rajendra Singh
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful
    http://sharepointundefind.wordpress.com/

  • When we click on the copy botton record with same name should not be saved

    Hi,
    Copy button will copy the record with the same name and will save it.our requirement is when we click on the copy botton ,record with same name should not be saved
    we are performing this task in custom object 12 and exposed Opportunity Name in the layout.
    Records with same Opportunity Name should not save ..when we copy the record
    Can we perform any field validation on Opportunity Name field?
    Please help
    please email me @ [email protected]
    Thanks
    Srinivas Merugu

    Opportunities that are assoicated to the same account cannot have the same name. You cannot make this unique for your whole instance. The only way that you could do this would be to create a webservice application that checks this before you save the record.
    What about defaulting the name each time this could make the record unique?

  • How to create directories with same name in different schemas

    I have two schemas on the same database.
    I am trying to create directories with same name, but different paths in both the schemas.
    When i created the directories in second schema, the directory paths of the first schema are automatically changed to the second path.
    Is there any solution to create directories with same name, but different path in two different schemas on the same database.
    Thanks,
    Sridhar.

    Hi,
    >>When i created the directories in second schema, the directory paths of the first schema are automatically changed to the second path.
    If you have removed the REPLACE clause of your create statement, then you would see that is not possible.
    SYSTEM> connect scott/tiger
    Connected.
    SCOTT> create directory mydir as '/tmp';
    Directory created.
    SCOTT> connect legatti/pwd
    Connected.
    LEGATTI> create directory mydir as '/tmp';
    create directory mydir as '/tmp'
    ERROR at line 1:
    ORA-00955: name is already used by an existing object
    LEGATTI> select owner,object_name,object_type,created
      2  from dba_objects where object_name='MYDIR';
    OWNER     OBJECT_NAME    OBJECT_TYPE         CREATED
    SYS       MYDIR          DIRECTORY           19/12/2007Cheers
    Legatti

  • How to separate two contact with same name

    Hi, anyone knows how to separate two contacts with same name in Contacts?  Actually they are two persons from two gmail contacts with same name but different contact numbers, different emails....etc, but Contacts assume they are same person and merge them as one!

    FG,
    In Lion, you have the File > Duplicate option. You will then have two copies of your document open, and the one on top will have the temporary filename "OriginalFileName copy", and your next responsibility is to File > Save (or Command-S) and rename the duplicate. At this point, you edit the copy's name, to perhaps ...copy 1, or whatever you wish. The document you had open when you initiated the File > Duplicate will still be there on your screen, waiting for you to Close it or continue editing.
    Jerry

  • How to create device IDs with same name

    i am using SE 3310 and its creating different device ids for each node sharing it . since I will be building a RAC enviornment I need these IDs/name to be same .
    for example  on one node the lun id is /dev/rdsk/c3t0d0s6  but the same lun id on node 2 is /dev/rdsk/c2t0d0s6.
    In past with an old storage array I fixed this issue by creating links  in /dev/rdsk for  c3t0d0s6 --->  c2t0d0s6.
    my question is : is there a way in SE3310 that device ids get created with same name or do i still have to rely on creating these soft links ?
    thanks
    Note: since i need the answer to this quickly i will wait a while and then post this question in other forums and i will update the question here with the answer .

    This could be a Solaris (I presumed) O.S. question rather than SE3310 or storage question.  
    The logical device (/dev/[r]dsk/*) is the work of the O.S. when it first configures the device,  in this case the LUN from your SE3310.   I can go in depth on how the cX number happens (due to device probe order, driver differences, history of device discovery due to need of persistent device naming, etc...) but ... it's a really long story and is really quite irrelevant and most people should not be interested...
    If you have COMPLETELY identical servers, i.e. identical hardware down to specific HBA in specific slot are the same,   and if you make sure that luns are presented to all servers exactly the same way, same order, and any changes are seen by all servers in the same sequence,  in theory,  all /dev/rdsk/* devices will be consistent across servers.
    But that's still rather irrelevant.    Application that is designed to work in a redundant environment should not be dependent on logical devices like /dev/rdsk being the same.
    So ... in effect this is also not a question for the Solaris forum,  but rather a question for those familiar with RAC,  how to configure such that device access is done "safely" through actually identifying the lun rather than assuming /dev/rdsk are consistent.

  • Can I run 2 different domains with same name but on 2 different machines?

    I am trying to setup 2 domains with same name (sharedcds1) on 2 different machines (Machine1 and Machine2).
              When I start the weblogic managed server 1 (sharedcds1managedserver1) on Machine2, it throws an error saying it has some conflicts with the managed server 1 running on Machine1. How did the managed server of one machine know about the other server. Can I run 2 different domains with same name but on 2 different machines?
              Here is the error in the log -
              <Jun 14, 2005 10:53:29 AM EDT> <Error> <Cluster> <BEA-000123> <Conflict start: You tried to bind an
              object under the name weblogic.transaction.coordinators.sharedcds1managedserver1 in the JNDI tree.
              The object from 4596206652609838848S:130.170.61.153:[9505,9505,-1,-1,9505,-1,-1,0,0]:sharedcds1:s
              haredcds1managedserver1 is non-clusterable, and you have tried to bind more than once from two or m
              ore servers. Such objects can only be deployed from one server.>
              <Jun 14, 2005 10:53:29 AM EDT> <Error> <Cluster> <BEA-000123> <Conflict start: You tried to bind an
              object under the name weblogic.transaction.coordinators.sharedcds1managedserver1 in the JNDI tree.
              The object from 8842351474821025197S:130.170.61.154:[9505,9505,-1,-1,9505,-1,-1,0,0]:sharedcds1:s
              haredcds1managedserver1 is non-clusterable, and you have tried to bind more than once from two or m
              ore servers. Such objects can only be deployed from one server.>
              Thanks
              Satish

    Yes you can. Make sure that domains configured to use different multicast address. WLS uses multicast for communications between nodes in domain.
              although your configuration will work, you could have troubles if you going to execute inter-domain calls between domains/servers with the same names.

  • Creation of BPEL with a WSDL having 2 operations with same name

    How to create a BPEL 2.0 from WSDL which is having the +2 operation with Same  name+ and we are planing to USE PICK activity but the BPEL is giving error while selecting the operation name
    can't create input variable.The selected operation does not have an input message.+
    WSDL:Operation
         <wsdl:portType name="ABC">
              *<wsdl:operation name="XYZ"*>
                   <wsdl:input name="Request1" message="tns:Request"/>
                   <wsdl:output name="Response1" message="tns:Response"/>
              </wsdl:operation>
              *<wsdl:operation name="XYZ">*
                   <wsdl:input name="Request2" message="tns:Request"/>
                   <wsdl:output name="Response2" message="tns:Response"/>
              </wsdl:operation>
         </wsdl:portType>
    Can you please provide the alternate solution if the procedure followed by us is wrong
    Thanks in Advance

    Hi Preetam,
    I believe it's not allowed, use different operation name.
    A wsdl:portType in a DESCRIPTION MUST have operations with distinct values for their name attributes.
    This applies only to the wsdl:operations within a given wsdl:portType. A wsdl:portType may have wsdl:operations with names that are the same as those found in other wsdl:portTypes.
    why do you need multiple operation with same message type?
    Regards,
    Faiz

  • Two methods with same name but different return type?

    Can I have two methods with same name but different return type in Java? I used to do this in C++ (method overloading or function overloading)
    Here is my code:
    import java.io.*;
    public class Test{
    public static void main(String ar[]){
    try{          
    //I give an invalid file name to throw IO error.
    File file = new File("c:/invalid file name becasue of spaces");
    FileWriter writer = new FileWriter(file ,true);
    writer.write("Test");
    writer.close();     
    } catch (IOException IOe){
         System.out.println("Failure");
    //call first method - displays stack trace on screen
         showerr(NPe);
    //call second method - returns stack trace as string
            String msg = showerr(NPe);
            System.out.println(msg);
    } // end of main
    public static void showerr(Exception e){
         StringWriter sw = new StringWriter();
         PrintWriter pw = new PrintWriter(sw);
         e.printStackTrace(pw);
         try{
         pw.close();
         sw.close();
         catch (IOException IOe){
         IOe.printStackTrace();     
         String stackTrace = sw.toString();
         System.out.println("Null Ptr\n" +  stackTrace );
    }//end of first showerr
    public static String showerr(Exception e){
         StringWriter sw = new StringWriter();
         PrintWriter pw = new PrintWriter(sw);
         e.printStackTrace(pw);
         try{
         pw.close();
         sw.close();
         catch (IOException IOe){
         IOe.printStackTrace();     
         return sw.toString();
    }//end of second showerr
    } // end of class
    [\code]

    Overloading is when you have multiple methods that have the same name and the same return type but take different parameters. See example
    public class Overloader {
         public String buildError(Exception e){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( e.getClass().getName() )
                   .append( " : " )
                   .append( e.getMessage() ) ;
              return buffer.toString() ;
         public String buildError(String msg){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( msg ) ;
              return buffer.toString() ;
         public String buildErrors(int errCount){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( "There have been " )
                   .append( errCount )
                   .append( " errors encountered.")  ;
              return buffer.toString() ;
    }Make sense ???
    Regards,

  • Two soa domain with same name "TestSOADomain" sharing same SOA schema ?

    I tried creating two soa domain with same name "TestSOADomain" (different path) sharing same SOA schema .However one domain came UP to Running mode and other domain going to AdminMode and "soa-infra" application of that domain is not active.
    I do want to understand can this be possible with SOA ,ie. two soa domain sharing same SOA schema ?
    If possible what are all the problems might come
    1. While executing soa composites with asyncronous behaviour ?
    2. How the polling services will work ?
    3. will the XREF_DATA table ROW_NUMBER column inserted uniquely while inserting data from two different domain into same SOA schema ?
    4. Other issues ?
    Thanks

    Each domain is expected to refer to its own unique database schema. Same SOA schema should not be shared by multiple SOA clusters/domains. It is technically possible though, I suppose, and still can run fine any one SOA environment at any given time with the other SOA environments/domains (sharing the same SOA schema) shutdown. It is not the general/recommended practice to share SOA schema across domains and there could be potential implications and unexpected behavior, particularly when the SOA environments pointing to the same schema are all running at a time.

  • Passing multiple URL parameters with same name

    Hi,
    I have a question which is not entirely related to Java. But although its related HTTP calls, so I thought I might get some ideas here.
    Background:
    I am making HTTP URL call from SAP ABAP code. Its pretty much similar to Java (creating URL connection, setting HTTP headers, connecting, receiving response and everything)
    For example,
    http://service_server:8080/a7/extension.services.SearchRequirements.a7x?RequestStatus=CR&RequestStatus=RR
    Now, this service_server runs a query to database where it uses both these values of "RequestStatus" to form 'OR' condition for a field.
    Issue:
    When I run this URL from browser, it shows XML response containing results for both values. In short, this is the ideal response.
    (I am using getParameterValues(string) at service_server to read multiple values for same parameter)
    But when I see response in SAP system, I see that it is returning data for only one value of 'RequestStatus'.
    I checked the logs of service_server, and I see that it has received only one parameter, not two.
    Question:
    It seems like SAP systems web server is truncating both parameters with same name and passing just one of them to outside server(??)
    Is there any configuration at Web Server side or any HTTP headers to be set so as to avoid this?
    Can anybody suggest something on this?

    I managed to resolve this issue by using HTTP 'Post' method to send the data.
    CALL METHOD CL_HTTP_CLIENT=>CREATE_BY_URL
        EXPORTING
          URL                = L_URL
        IMPORTING
          CLIENT             = L_HTTP_CLIENT
        EXCEPTIONS
          ARGUMENT_NOT_FOUND = 1
          PLUGIN_NOT_ACTIVE  = 2
          INTERNAL_ERROR     = 3
          OTHERS             = 4 .
    "STEP-2 :  AUTHENTICATE HTTP CLIENT
    CALL METHOD L_HTTP_CLIENT->AUTHENTICATE
      EXPORTING
        USERNAME             = 'name'
        PASSWORD             = 'password'.
    "STEP-3 :  SET HTTP HEADERS
    CALL METHOD L_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
          EXPORTING NAME  = 'Accept'
                    VALUE = 'text/xml'.
    CALL METHOD L_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
        EXPORTING NAME  = '~request_method'
                   VALUE = 'POST' .
    CALL METHOD L_HTTP_CLIENT->REQUEST->SET_CONTENT_TYPE
        EXPORTING CONTENT_TYPE  = 'application/x-www-form-urlencoded' .
    "SETTING REQUEST DATA FOR 'POST' METHOD
    IF L_PARAMS_STRING IS NOT INITIAL.
       CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
         EXPORTING
             TEXT   = L_PARAMS_STRING
         IMPORTING
               BUFFER = L_PARAMS_XSTRING
         EXCEPTIONS
            FAILED = 1
            OTHERS = 2.
    CALL METHOD L_HTTP_CLIENT->REQUEST->SET_DATA
        EXPORTING DATA  = L_PARAMS_XSTRING  .
    ENDIF.
    "STEP-4 :  SEND HTTP REQUEST
      CALL METHOD L_HTTP_CLIENT->SEND
        EXCEPTIONS
          HTTP_COMMUNICATION_FAILURE = 1
          HTTP_INVALID_STATE         = 2.
    "STEP-5 :  GET HTTP RESPONSE
        CALL METHOD L_HTTP_CLIENT->RECEIVE
          EXCEPTIONS
            HTTP_COMMUNICATION_FAILURE = 1
            HTTP_INVALID_STATE         = 2
            HTTP_PROCESSING_FAILED     = 3.
    "STEP-6 :  READ RESPONSE DATA
    CALL METHOD L_HTTP_CLIENT->RESPONSE->GET_CDATA
            RECEIVING DATA = L_RESULT .
    "STEP-7 : CLOSE CONNECTION
    CALL METHOD L_HTTP_CLIENT->CLOSE
      EXCEPTIONS
        HTTP_INVALID_STATE = 1
        OTHERS             = 2   .
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • While saving multiple attachments from mail, files with same name are added and not replaced

    While saving Multiple Attachments from Mail, existing file with same name are not overwritted but new files are added in the folder.

    Bjørn Larsen a écrit:
    Hi all
    Hope to get some help with Elements Organizer.
    I have 12-15 years of digital photos that I now want to import into my newly aquirede Adobe Elements Organizer / Photoshop. Since my Nikon names the files with continous numbers from 0001 to 9999 I have multiple files with the same name although they are not alike at all. My previous software had no problems with that since I keep the photos in separate file folders based on import date. I generally import photos after each event and so name the folder with the date and some event info (e.g. 2014.12.24 - Christmas at grandparents).
    That is a common situation, I have the same limitation for files not going over 9999 on my Canons...
    Now - when I import my photos into Elements Organizer I get a lot of error messages with "same name exist .....) Hmmmmmmm
    Please sate the exact wording of the error message, I have never seen a message stating 'same name exist...' or equivalent; only messages about files already in the catalog. Files already in the catalog mean that some files have the same 'date taken' and file size in Kb.
    Any suggestions. I'm using a mac and tried to rename files based on date taken. The mac can do that but it takes ages to go into each folder and run the renaming script there.
    I also use a similar folder creation scheme (such a date naming is the default for the downloader). That way I never get a message about duplicates for the same file names.
    However - I can't be the first or only person with this problem so I figure that some workaround must be known out there. Maybe the import action can recognize date taken or - well. Thank you very much in advance if you can help me out here.
    You can alsways set the downloader to rename the imported files with a unique new name, there are many options in the 'advanced' dialog of the downloader. I don't know about Macs, but I don't thing there is a difference.

  • How to get Unique calid for users with same name in multiple domain env..

    I found we need to use "-k legacy" option for creating users in non-hosted setup..
    I had two domains default as xxxx.com and the one that I created as yyyy.com
    When I have users with same name in two of the domains as user1..
    The calid for both of them is... user1 ....so they share the same calendar
    When Im in valid SSO of yyyy.com I get the mail account for user1 as [email protected] .....but the calid .. common as user1
    How I can get unique calid for users under two domains..
    whether I need to set Hosted domain support...Then how the mailid's differ with out using hosted domain support..
    And I need to login UWC without using @domain.com...
    Help me on this...
    Ashik

    Do you have UWC and Cal configured at least for virtual domain support?
    basically.. for discussion.. let's say you have three domains on your server.. 1st domain is the default domain. other 2 domains are virtual domains.
    if all domains were created with mail and cal support (-S mail,cal).. you would use the following options when creating users:
    1) for the default domain.. you must use the "-k legacy" option when adding users.
    2) for the other two domains.. when you create the user.. do NOT use a "-k" option.
    If you do not use the "-k" option.. it defaults to "hosted" which will cause the user's calid to be [email protected]
    If you Do use the "-k legacy" option.. it will create the calid as just "userid"
    With regard to logging into UWC without the @domain.com part of a username in a hosted domain.. the easiest way to avoid this.. is to point a host name under the hosted domain to the server.
    if you point webmail.xxxx.com to the server... and then access it via:
    http://webmail.xxxx.com/uwc/
    any users in the xxxx.com hosted domain will NOT need to use @xxxx.com when logging in... they can just use "userid"
    This feature does not take any special configuration (aside from adding a DNS entry for the hosted domain)
    Hopefully that helps.

  • How to delete one existing file before uploading a file with same name?

    Hello everybody.
    I am uploading a file to Tomcat server. But, the problem is:
    i want to delete an existing file in the server, if i upload a fresh file with same name. In other words, "First check for the file with the same name in the server. If it exists, then delete existing file in the server and upload fresh one". If such file doesnot exist, then upload the file to server.
    I have given deleteonExit()
    but, for the first time when user is uploading, i want to check for the file with same name in the server.
    i am pasting the code here. please help:
    <!-- uploading the file -->
    <%
    String contentType = request.getContentType();
    if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0))
    DataInputStream in = new DataInputStream(request.getInputStream());
    int formDataLength = request.getContentLength();
    byte dataBytes[] = new byte[formDataLength];
    int byteRead = 0;
    int totalBytesRead = 0;
    while (totalBytesRead < formDataLength)
    byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
    totalBytesRead += byteRead;
    String contextRootPath = this.getServletContext().getRealPath("/");
    contextRootPath=contextRootPath.concat("uploaded");
    String file = new String(dataBytes);
    String saveFile = file.substring(file.indexOf("filename=\"") + 10);
    saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
    saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1,saveFile.indexOf("\""));
    // Create a directory; all ancestor directories must exist
    File outputFile = new File(contextRootPath, saveFile);
    var=outputFile.getPath();
    outputFile.createNewFile();
    int lastIndex = contentType.lastIndexOf("=");
    String boundary = contentType.substring(lastIndex + 1,contentType.length());
    int pos;
    pos = file.indexOf("filename=\"");
    pos = file.indexOf("\n", pos) + 1;
    pos = file.indexOf("\n", pos) + 1;
    pos = file.indexOf("\n", pos) + 1;
    int boundaryLocation = file.indexOf(boundary, pos) - 4;
    int startPos = ((file.substring(0, pos)).getBytes()).length;
    int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
    FileOutputStream fileOut = new FileOutputStream(outputFile);
    fileOut.write(dataBytes, startPos, (endPos - startPos));
    fileOut.flush();
    fileOut.close();
    outputFile.deleteOnExit();
    %>Please help. Thanks for taking time.
    Regards,
    Ashvini

    Thank you MartinHilpert,
    I have one more doubt,
    I am uploading the file to one folder called "uploaded". Before uploading a fresh file, i want to delete all existing files in that folder. IS that possible ?? If yes, can you please tell me how to do that ??
    Regards, Thanks for your time.
    Ashlvini

Maybe you are looking for