How to check whether file exist in a folder at the application server

Hi to all experts.
if suppose there is a file at the application server test.txt my requirement if the one more file is created of the same name before overwriting the file a warning message is to displayed to the user that the file already exist .
how to do it

HI Mohammed,
use The FM DX_FILE_EXISTENCE_CHECK
or static class CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
For more info
search file in application server
application server
hope it helps you.
Regards!

Similar Messages

  • How to check whether file exist or not?

    hello,
    i wanted to know that how can i check whether a file exist or not independent of underlying Operating system?
    please help .
    Thank you.

    Use exists() on a File instance.

  • URGENT!!! how to check whether file exist or not on client side?

    hello,
    i am building appilication using JSP and javabeans.
    Problem is my application is like on server files are there for say colors and their corresponding car image in that color.so when i move my mouse over that particular color ,its corresponding car image is displayed.
    now say someone has deleted that corresponding car image file but image of color is there...........
    so i have to handle such excpetion.
    like if corresponding car image for that color is not there then that color image should also not be displayed.
    i dont want to do this checking on server side.
    pls help me!!!!!!

    You don't have access to the client files. It is a security violation in a normal internet environment. Imagine what people could do to your computer if they could see everything on it.

  • How to Check Images File Exist? in different server

    Hi,
    I have 10 different coldfusion server.
    for example 9 server is for the web application site - for
    example
    http://myserverone/studentweb
    the other one is for images website, just for displaying
    student picture - for example
    http://myserverimage/studentpicture.
    the purpose of this website is to display student picture
    that i store as gif files.
    from my studentweb website i will call the images from
    studentpicture website as source for my image placeholder.
    for example this is my code i'm calling form
    http://myserverone/studentweb
    website:
    <img src="
    http://myserverimage/studentpicture/#studentnumber#.gif"
    alt="" name="studentpicture" width="160" height="200">
    my problem is, if there is no specific student picture in my
    studentpicture website, then the placeholder will display an X (
    mean the images not found )
    how do i prevent the X to display?
    how do i using coldfusion or any kind of way to check if the
    images exist on that website ( different server ), so if the images
    is not found, i can display a default images? i can do this if i'm
    calling the website in the same server, but not using a different
    server.
    this is like using other website images for your own personal
    website and sometimes the owner delete the images from their
    website, and i want to display my own images if that images been
    removed from the source website.
    anyone have done this before?
    thanks for suggestion and guide...
    haire

    1. Use CFHTTP with method="HEAD".
    2. See, if the HTTP status code is 200.
    The head-method is of course more efficient, as it doesn't
    need to "get" the message body. However, a status code of 200 is
    possible even when the requested image file is no longer on the
    server.

  • How to check whether a default browser is opened in the operating system?

    Hi,
    I am newbie here. During my work, I faced an interesting problem. I need to:
    - check whether a default html browser is opened;
    - check whether the browser is minimized/maximized (simply, a window's state);
    - get an url address typed in the browser.
    If any of these conditions is not met, I have to open the browser in a maximized view with a desired url address. I primarily wanted to do all this in Java, but it came to my mind that I should employ many techniques/technologies and combine them appropriately to complete the functionality. But, which ones? That's the problem. I just recalled Windows API, but I'm not sure if it is of any help... On another forum, some users suggested that I should consider JNI... At this time, I only know how to open a default browser (e.g. with use of the 'browse(URI uri)' method of the 'java.awt.Desktop' class) - that's too little to be proud of. Please give me some hints, maybe links to reasonable discussions, I would greatly appreciate any suggestions how to approach the problem.

    Crosspost! [http://www.java-forums.org/advanced-java/29583-how-check-whether-default-browser-opened-operating-system.html]

  • How to check if a user session is active in Java application server

    Hi Experts,
          We have a online scenario with a third party system by which a portal user will launch the third party application in a new window from portal. The SSO will work at the third party web application with the dynamic key that is generated by calling a webservice for that user. Now, as the user works on the launched screen, they will have to check whether the user (logged in portal) session is still active. ie., they will be periodically calling a service hosted by SAP java application server to find out whether the corresponding user who launched the session is still logged in or logged out.
    So, my question is, how can i find out programatically whether a user/user's session is still logged in/active in SAP Netweaver Java AS? We are in version 7.3.
    Kindly help me in this regard.
    Regards
    Vijay.K

    Hi Vijay,
    Could you check below links
    Tracing Single User Sessions - Administration - SAP Library
    Display and Manage User Sessions (SAP Library - Tools for Monitoring the System)
    Hope this helps.
    Regards,
    Deepak Kori

  • How to stream flv files from a diffferent directory outside the applications folder

    Hi everyone,
    I want to stream the flv files from a different location
    stored in the hard disk, which is outside the applications folder
    in the FMS installation root directory. Does anyone know how to do
    it?
    Regards,
    Diptanu

    VOD changes won't help him, he said outside the applications
    folder. According to adobe any new vod folders must be in the
    applications folder, hence virtually worthless for most purposes. A
    better question may be, how do you specify a folder on a different
    local hard drive. I wish adobe wouldn't make it so complicated, it
    should be a really simple matter.

  • Saving a file in a particular folder over the tomcat server

    I have a java class in the background of a JSP which creates an XML file and saves it.
    Furthermore another class picks that file and processes it. While running this program on my local computer it is obviously working fine but in order to run it on a tomcat server or for that matter any server, I want it to save the XML file in a particular folder, for example:
    tomcat_home/webapps/myapplication/ xmlfolder / something. xml
    so that my other class can easily pick up the file and I dont need to change the location each time I change the server.

    You can get the context root(the place from wher the aplication is running) of your application and then save the file somwhere, but i >>woulden't recomend that. But this is what you are looking for.How ?
    You can also just save the file, it will be saved in a temp directory. (use this only if the file is a temp file not for storing purposes)Just saving the file somehow doesnt work for me as the folder where a class is saving a file by default is somehow different from the folder where another class is trying to pick a file by default. Even if I give no path
    Other option is just to configure a tomcat system variable that specifys an folder. You can get that property from your application and >>then save the files there.Im not able to consider this one because the application will be put on different servers by different people later so they would all then need to configure their systems just to read a file. I was sure there were better ways. :(

  • How To Check Whether Physical Standby is in Sync with the Primary

    hi All,
    I'm new in data guard. In our current production, my boss is asking me to write a shell scripts monitoring physical standby and primary archive is sync (archive gap)
    I'm referring metalink [ID 861595.1], but when i ran the first query in Primary node, the screen hang.
    On primary
    ========
    SQL> SELECT THREAD# "Thread",SEQUENCE# "Last Sequence Generated"
    FROM V$ARCHIVED_LOG
    WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)
    ORDER BY 1;
    I tried to turn on 10046 SQL trace, the SQL consume a lot of CPU, and it full table scan in X$KCCAL table.
    TKPROF result look like below:
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1     88.29     115.59          0          0          0           0
    total        3     88.30     115.60          0          0          0           0
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1 Optimizer mode: ALL_ROWS Parsing user id: 80 
    Rows     Row Source Operation
          0  SORT ORDER BY (cr=0 pr=0 pw=0 time=21 us)
          0   FILTER  (cr=0 pr=0 pw=0 time=19 us)
       1124    FIXED TABLE FULL X$KCCAL (cr=0 pr=0 pw=0 time=40537 us)
          0    FILTER  (cr=0 pr=0 pw=0 time=115538625 us)
       1122     HASH GROUP BY (cr=0 pr=0 pw=0 time=115530193 us)
    7465972      FIXED TABLE FULL X$KCCAL (cr=0 pr=0 pw=0 time=94648975 us)
    Elapsed times include waiting on following events:
      Event waited on                        Times   Max. Wait  Total Waited
      -----------------------------------   Waited  ----------  ------------
      SQL*Net message to client               1        0.00          0.00
      control file sequential read        16841        0.05         30.88
      SQL*Net break/reset to client           1        0.00          0.00Due to this is production environment, thus i had terminated the session, can anyone teach me or share with me any scripts to monitor physical standby is sync with primary or not? Or do you encounter the above issue when running the SQL?
    My db version is Oracle 11.2.0.1.0
    Thanks in advance.
    Regards,
    Klnghau

    Hello;
    Note 861595.1 has not been subject to an independent technical review. Not sure if that make it bad or not.
    This is what I'm using: ( I spool this to a file and have it e-mailed to me daily)
    PROMPT
    PROMPT Checking last sequence in v$archived_log
    PROMPT
    clear screen
    set linesize 100
    column STANDBY format a20
    column applied format a10
    SELECT name as STANDBY, SEQUENCE#, applied, completion_time from v$archived_log WHERE DEST_ID = 2 AND NEXT_TIME > SYSDATE -1;
    prompt
    prompt----------------Last log on Primary--------------------------------------|
    prompt
    select max(sequence#) from v$archived_log where NEXT_TIME > sysdate -1;
    Best Regards
    mseberg

  • Working with File Properties on the Application Server

    Hi,
    I am looking for a way to get the size of a file existing in a directory in the application server without reading it.
    Is there a function module or a static method that returns a file properties exists in the application server?
    Thanks,
    Eyal.

    hi Eyal,
    fm <b>EPS_GET_FILE_ATTRIBUTES   </b>
    regards Andreas

  • Checking  Whether Physical Standby is in Sync with the Primary

    I writing script to alert dba if primary and standby database are not in sync. I use article - How To Check Whether Physical Standby is in Sync with the Primary? ID 861595.1      
    It suggests comparing Last Sequence Generated on primary and Last Sequence Received on standby for each thread. And if they are not equal - NOT in sync.
    My assumption is that if there are multiple threads we running RAC. Is it correct ?
    And if we running RAC as far as I am aware it's sufficient to have one thread in sync.
    Please comment on this
    Thanks in advance
    Edited by: user613441 on Jan 6, 2010 9:16 PM
    Edited by: user613441 on Jan 6, 2010 9:17 PM

    deleted

  • Moving of flat file from the application server after upload.

    Hi All,
    I am uploading data from a flat file placed on the application server by a BDC program.
    After the BDC has created the session i want to transfer the flat file from that folder to another folder on the application server by changing the name of the flatfile.
    Can any one suggest the best way of doing this particular scenario?
    Thanks in advance.
    Regards
    Satish Nair.

    Here is a sample program.
    report zrich_0001.
    data: d1 type localfile value '/usr/sap/TST/SYS/Data1.txt',
          d2 type localfile value '/usr/sap/TST/SYS/Data2.txt'.
    data: begin of itab occurs 0,
          rec(20) type c,
          end of itab.
    data: wa(20) type c.
    start-of-selection.
      open dataset d1 for input in text mode.
      if sy-subrc = 0.
        do.
          read dataset d1 into wa.
          if sy-subrc <> 0.
            exit.
          endif.
          itab-rec = wa.
          append itab.
        enddo.
      endif.
      close dataset d1.
      open dataset d2 for output in text mode.
      loop at itab.
        transfer itab to d2.
      endloop.
      close dataset d2.
      delete dataset d1.
    Regards,
    Rich Heilman

  • Regarding moving files b/w folders in the Application server

    Hi,
    I need to move the file from one folder(main folder) of the application server to another (eg, archive, error) with certain conditions. When I try to move file from main folder to archive folder, it is working fine (.txt). The file along with the contents are moving, but when I try to move the file from main folder to error folder (.err), though the file has moved, the contents are not showing (though the file is erased from the main folder). I have used the function module
    SXPG_COMMAND_EXECUTE for performing these actions.  Can any one suggest as to why the contents are not showing.
    LEAR:  lv_mv_command_exitcode,
              lv_mv_command_arguments,
              lv_dummy_string.
      CONCATENATE is_dir_list-fullname iv_error_file INTO lv_mv_command_arguments
      SEPARATED BY space.
      REFRESH lt_mv_command_stdout.
      CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
        EXPORTING
          commandname                   = 'ZMV'
          additional_parameters         = lv_mv_command_arguments
        IMPORTING
          exitcode                      = lv_mv_command_exitcode
        TABLES
          exec_protocol                 = lt_mv_command_stdout
        EXCEPTIONS
          no_permission                 = 1
          command_not_found             = 2
          parameters_too_long           = 3
          security_risk                 = 4
          wrong_check_call_interface    = 5
          program_start_error           = 6
          program_termination_error     = 7
          x_error                       = 8
          parameter_expected            = 9
          too_many_parameters           = 10
          illegal_command               = 11
          wrong_asynchronous_parameters = 12
          cant_enq_tbtco_entry          = 13
          jobcount_generation_error     = 14
          OTHERS                        = 15.
      IF sy-subrc <> 0 OR lv_mv_command_exitcode <> 0.
        CONCATENATE 'Error in File'
                    iv_basefile
                    'but,not moved to Error folder.'
        INTO lv_dummy_string SEPARATED BY space.
        WRITE: / lv_dummy_string.
        IF sy-batch = c_flag_on.
          MESSAGE e054 WITH iv_basefile.
        ENDIF.
      ELSE.
        CONCATENATE 'Error in File,'
                    iv_basefile
                    'moved to Error folder.'
        INTO lv_dummy_string SEPARATED BY space.
        WRITE: / lv_dummy_string.
        IF sy-batch = c_flag_on.
          MESSAGE s055 WITH iv_basefile.
        ENDIF.
    Regards,
    John

    Hi,
    Here what I found was, if the file is empty, then the system is not moving the empty file to the destination , but if the file is not empty it is copying the contents and the corresponding folder to the destination folder. My intent is to copy the folder even if the contents of the folder is empty to the destination folder and delete the old file.
    regards,
    John

  • How to check whether a file exist in the program folder or not?

    Hi guys,
    how to check whether a file exist in the program folder or not? Let is say i recieve a file name from user then i want to know if the file is there not and act on that base.
    abdul

    Look at the class java.io.File and the .exists() method:
    http://java.sun.com/j2se/1.4/docs/api/java/io/File.html

  • How to check whether a file is present in the UNIX directory of app. server

    Hi,
            I am creating files in the UNIX directory in the application server using :
                       CONCATENATE '/sapmnt/RD1/interfaces/client670/'
                       p_fname '.CSV' INTO w_filename.
               OPEN DATASET w_filename FOR OUTPUT IN TEXT MODE.
              LOOP AT t_output1.
                      TRANSFER t_output1 TO w_filename.
              ENDLOOP.
             CLOSE DATASET w_filename.
    I am unable to check whether a file with the same name exists or not. How to check the duplicate state of the file.

    You can use the following fm
    RZL_READ_FILE
    or
    use OPEN DATASET FOR INPUT.

Maybe you are looking for

  • Using a second computer as a software synth

    Hi Folks I'm just thinking of running an old computer as a software synth and was wondering what I would need, i.e. midi interface, sound card and any advice that could be give so that I can sync the two machines up and get them working. TTFN Lotus E

  • SD - Manual entries allowed for item category in the Sales Order

    Hi experts, please do you know any OSS note related to SD, in order to increase the number of Manual entries allowed for item category in the Sales Order (table T184)? Thank you very much Andrea

  • While loop in a for loop,Is it possible?

    Is It possible to call a while loop a particular number of time's using a for loop. for example : for(.....){ while(true) Is this technically possible? Thanks,

  • Two Computers on Router; Don't See Each Other

    Two computers, each connected wirelessly to same FiOS router. Each connects perfectly to the Internet, but cannot see each other (ping test). Normal? Some little change in firewall setting needed? HaroldWho

  • Who is Core DBA

    Who is Core DBA - What are the tasks of a Core DBA - Avilability of Core DBA Jobs - Eligibility for the Core DBA Jobs thanks and Regards