How to know if a file exists before uploading or downloading

Is there FM to know it a file exists or not before doing anything with it?
thanks

Hi,
       use call function GUI_upload if file present
      sy-subrc  will be 0 ELSE fm RESULTS IN ERROR
     ALL FUNCTION 'GUI_UPLOAD'
       EXPORTING
            filename                = filename
            filetype                = 'ASC'
       TABLES
            data_tab                = cofdata
       EXCEPTIONS
            file_open_error         = 1
            file_read_error         = 2
            no_batch                = 3
            gui_refuse_filetransfer = 4
            invalid_type            = 5
            no_authority            = 6
            unknown_error           = 7
            bad_data_format         = 8
            header_not_allowed      = 9
            separator_not_allowed   = 10
            header_too_long         = 11
            unknown_dp_error        = 12
            access_denied           = 13
            dp_out_of_memory        = 14
            disk_full               = 15
            dp_timeout              = 16
            OTHERS                  = 17.
  IF sy-subrc <> 0.
    MESSAGE i110 WITH sy-subrc 'cofile' filename.
    EXIT.
  ENDIF.
Regards
amole

Similar Messages

  • 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

  • File Adapter - Check file exist before performing read

    Is there a feature in the file adapter or invoke activity for SOA 11.1.1.5 that performs a check to see if a specific file exists before it performs a read function? If file does not exist then move onto to next step, if it does then read it.
    I am trying to do this in 1 step instead of performing a listing of the directory first before perfomring the read.

    Hi,
    When you read a file, using the synchronous read file, you have to point to a file (file name, directory...). That way, when you are executing the invoke activity, followed by a FileAdapter, it's either the file exists, and you read it, or it's not exist and you don't read it.
    Arik

  • How to know if a file has been updated in iCloud after modification?

    How to know if a file has been updated in iCloud after modification?
    I work on various app including Keynote on my Mac Pro. And after modification, i close file and I wait.
    When I see no more Internet traffic. I assume that keynote has uploaded all the works I have done into iCloud.
    But when I open the same file on my iPad on the way to work. I do not see the file updated.
    I assume that I did not wait long enough.
    I wished I had a way to enforce the updated file to upload and way to get confirmation that it has been completed.
    In windows I simply push the sync button.
    But for iCloud I do not yet see anything like that.
    Please help.

    you would be better served asking this in the iCloud discussion, where users are more knowledgeable about iCloud. Replies on iOS and iCloud issues are usually unanswered here because of our lack of knowledge.

  • How can i find the file size before downloading

    I am trying to decide if I want to download a tv show [Doctor Who] in standard definition or high definition.  How can I see the file size before I purchase the show from iTunes?

    1. That's only getting the file size of the Preview.
    2. Click on a photo to select it. Then click on the info button. You can get the dimensions and the file size in the top of the pane
    Note that the final size of any image will depend on the export settings you choose.

  • JavaScript: How to check if a file exists.

    Hello Everybody,
    Can you tell me how to check if a file exists using JavaScript and Internet Explorer.
    Browsing on this website I could read about the command "f.exists()" and it was necessary to include "java.io.*".
    Should I use this same command and should I include the same files? Or are there other files and other commands?
    Thanks in advance.

    sorry ya. there is no command to check whether a file exists using javascript. The following code says the object name and value. But it can't say whether the file exists in the harddisk or .. Javascript cannot access database and system resources. If the file exists or not can be checked through the application (ASP, CFML, ..) you are using.

  • How to know whether a file is opened  or not ?

    Hi all,
    How to know whether a file is opened by its editor or not ? File may be any of the type.

    There are platform-dependent commands that tell whether a file (or directory, port etc.) is used by which processes.
    [oracle@izsak ~]$ fuser .
    .:                    9299c
    [oracle@izsak ~]$ ps -p  9299 -f
    UID        PID  PPID  C STIME TTY          TIME CMD
    oracle    9299  9298  0 Apr25 pts/0    00:00:00 -bash
    [oracle@izsak ~]$ ls -l $fn
    -rw-r-----  1 oracle oinstall 111215876 Apr 25 19:05 /opt/oracle/product/AS/10g/R2/opmn/logs/OC4J~ebank~default_island~1
    [oracle@izsak ~]$ fuser $fn
    /opt/oracle/product/AS/10g/R2/opmn/logs/OC4J~ebank~default_island~1:  3746  3747  3748  3749  3750  3751  3752  3753  3754  3755  3756  3758  3761  3762  3765  3767  3769  3770  3771 18638 21605 21743 21744 21745 22140 22143
    [oracle@izsak ~]$ ps -p 3746 -f
    UID        PID  PPID  C STIME TTY          TIME CMD
    oracle    3746 26427  0 Apr23 ?        00:00:01 /opt/oracle/product/AS/10g/R2/jdk/bin/java -server -Djava.security.policy=/opt...

  • How can clients view video file that I upload to my Creative Cloud area?

    How can clients view video files that I upload to my Creative Cloud area?  Is there a special password that they have to use to gain access?
    Thanks for any guidance.
    Dave

    As a video professional, i agree and am VERY disappointed with this policy.  I attended CC presentations at various conventions, film festivals and meetups for a year-and-a-half before I made the leap to CC, and no one EVER mentioned a restriction to transferring video files.
    Whether it's to save storage space or not, that's how it APPEARS to the end user.  Anybody who knows ANYthing about how video pirates commit their crime (which it most-certainly is), knows that there are plenty of FREE, untraceable (or nearly-anonymous) resources to carry it out.  The need for anyone to pay $30 or more per-month to do it with an acct that has their info attached to it is ludicrous!  If anything it's CONTRIBUTING to piracy to encourage creatives to transfer their material to collaborative parties using a less-secure, more heavily-trafficked third-party service than the one they're paying for exclusive use for.
    Adobe's policy makers need to review this restriction and remove it or provide ANOTHER reason why it exists because this one doesn't fly.  And if it continues, make sure a disclaimer gets inserted in CC pitch presentations because likely half of the attendees are working with video.

  • SPD 2010 - How to know if a file with a given name already exists in a document library

    Hi,
    I've created a workflow using SPD. One of the steps in there is changing the name of the document to a clean name. This workflow fails if a document with this same name already exists in my document library. Is there a way to check in a SPD workflow if
    a document with a given name already exists in my document library ?
    Marc Nemegeer

    Hi,
    According to your post, my understanding is that you wanted to know if a file with a given name already exists in a document library.
    You can use a SharePoint Designer workflow to achive it.
    To test to see if a document exists, you need to use condition:
    If Current List:Name  equals  [%Current Item:Title%].docx
    Here is a similar thread for you to take a look at:
    http://social.technet.microsoft.com/Forums/en-US/cc227020-ce81-4c08-aee0-a66789d8ad05/test-to-see-if-document-exists?forum=sharepointcustomizationprev
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How to check whether a file exists or not

    i am in an image uploading utility. i hav succesfully uploaded the image to the server directory (say /uploads). but when displaying the uploaded image, i wanna show the picture only if the image exits (bcoz for some records there is no image). so i hav used this code
    if(new File("uploads/1.jpg").exists())
         out.print("image exists");
    but its not working for me. i got it working fine when i give the full path "D:/Tomcat/webapps/diary/admin/uploads/1.jpg". but i think giving this absolute path is not an efficient method bcoz its a web application, bcoz i may not be able get the absolute path always. so how can i do this by specifieing the relative path
    help me ASAP if u can
    aleens

    Haii ameen
    This is one way to rectify your problem..
    if(new File("uploads/1.jpg").exists())
    out.print("image exists");
    instead of this u can write like
    <%
    ServletConfig cf=getServletConfig();
    ServletContext c=cf.getServletContext();
    if(new File(c.getRealPath("uploads")+"/test.txt").exists())
    out.print("image exists");
    %>If u are not clear of what it is done let me know..i will xplain to you furthur...
    Happy New Year
    Shanu

  • How to find child records is exists before to delete parent records.

    Dear Everyone,
    I would like to ask you, is there any simple way to find child records is exists before to delete parent records.
    I have a master table defined primary key and I have referenced that as foreign key in many tables.
    I have used Delete_Record to delete but it isn't display the message 'child record exist' but it cleared the record from the form. So I need to know how to find child records is exists or not before to do delete_record so that I can display message in-case it exists.
    I do know we can able to check in every table matching the column manually, but what if we use 100 of tables then it is not possible to check manually.
    I am sure there must be simple way to find as how the oracle identifies when we execute delete query.
    Please help me on this.
    Thanks in advance.

    Simple solution is to run the query I have given for all child tables or to try a single query for all child tables withj something like:
    select <parent_key>
    from <parent_table>
    where <parent_key> in
              (select <foreign_key_1> from <child_table_1> union
               select <foreign_key_2> from <child_table_2> union
               ... );More complicate solution could be to change the foreign key constraints to cascade DELETE on parent table to child tables:
    SQL>
    SQL> create table p(x int primary key);
    Table created.
    SQL> create table c1(x1 int);
    Table created.
    SQL> create table c2(x2 int);
    Table created.
    SQL>
    SQL> alter table c1 add constraint fk1 foreign key(x1) references p;
    Table altered.
    SQL> alter table c2 add constraint fk2 foreign key (x2) references p;
    Table altered.
    SQL>
    SQL>
    SQL> insert into p values(1);
    1 row created.
    SQL> insert into c1 values(1);
    1 row created.
    SQL> insert into c2 values(1);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL>
    SQL> alter table c1 drop constraint fk1;
    Table altered.
    SQL> alter table c2 drop constraint fk2;
    Table altered.
    SQL>
    SQL> alter table c1 add constraint fk1 foreign key(x1) references p on delete cascade;
    Table altered.
    SQL> alter table c2 add constraint fk2 foreign key (x2) references p on delete cascade;
    Table altered.
    SQL>
    SQL> delete p where x=1;
    1 row deleted.
    SQL> commit;
    Commit complete.
    SQL> select * from p;
    no rows selected
    SQL> select * from c1;
    no rows selected
    SQL> select * from c2;
    no rows selected
    SQL>Edited by: P. Forstmann on 27 oct. 2011 14:01

  • How to detact if a file exist in a folder

    How can I detact a file (a jpg or flv) exists in a folder?
    The script that I can think of so far is like this,
    var filename:String= "videos/vid test 0110.flv";
    if (filename){
    trace("well done");
    }else{
    trace("sorry");
    Please help me on this problem if you know....
    Thanks.
    Lau

    Sorry I have to rephrase the word - detect - to "check",
    sounds more pricisely...
    How can I check a file (a jpg or flv) exists in a folder?
    for instance flash can check if there is an instance exist or
    not on the timeline, for example a movie clip is called myMovie_mc.
    if (myMovie_mc){
    trace("myMovie_mc exist");
    }else{
    trace("sorry myMovie_mc doesnot exist");
    This is checking the instance on the timeline... but what I
    need is the check if a file (a flv file) exists or not in a folder
    outside the fla file.
    If that flv does exist in that folder ("videos" I called it),
    then the flash will take some actions. if it does not exist, then
    flash will do something else, like gotoAndPlay("default Intro").
    It will be much appreciated if anyone of you can sort this
    problem out for me.

  • How to know whether the file is opened or not

    Hi All,
    In the file handling,
    Before writing OPEN DATA SET, I want to know the file is already opened or not.
    Please help me out in this regard.
    Thanks and regards,
    Mallareddy

    Hi,
    Please try GET DATASET statement.
    Syntax:
    GET DATASET dsn.
    Extras:
    1. ... POSITION pos
    2. ... ATTRIBUTES attr
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. For details, see File Interface.
    Effect
    Used to get the properties of a file already open.
    You can use this statement without additions to determine whether the file is open.
    If the file is not open, an exception of the type CX_SY_FILE_OPEN_MODE is triggered.
    Regards,
    Ferry Lianto

  • How to test an image file existing or not

    Hi Everyone,
    I want to test whether an image file exists or not before setting the url of an image component in JSF to it. Following is my code:
    File testFile = new File(image_path + "/p1.jpg");
    if(testFile.exists()){
    info("file exists");
    }else{
    info("file not exists");
    this.myImage.setUrl(image_path+"/p1.jpg");
    Althoug the p1.jpg can be linked to myImage, the existence test always fails. That is, I got the message "file not exists" even though it is already displayed.
    What did I do wrong?
    Thanks in advance,
    Message was edited by:
    field

    File testFile = new File(image_path + "/p1.jpg");Is image_path an absolute path or relative path?

  • Streaming audio file over the network w JMF. How to know when the file end

    Hi
    I am streaming audio file over the network using JMF. I want to be able to know when a file end so I can close the streaming session.
    Can some one please help
    Thanks

    If you put a ControllerListener on the Processor that's associated with generating the RTP stream, it'll generate an "EndOfMedia" event when the end of the file is reached.

Maybe you are looking for

  • How to add a single check box and a label to a image in Muse?

    Hello! I need help with adding a check box with a label to the right of it. I know about the forms, and how you can add a check box there but i don't need all the other form options.

  • Error while importing configuratio data of stellent 7.5.1 in OCS 10gR3

    Hi, I am upgrading Stellent 7.5.1 to Oracle Content Server 10gR3. On Stellent 7.5.1 I created a Template i.e. wwCmuExport and then explicitly selected Aliases, Security Groups, Roles & Personalization Data from Content Server Section. While importing

  • Acrobat Pro X Failed After Latest Update Downloaded

    I have been using Acrobat Pro X on my Windows 7 machine successfully for almost 2 years now.  After the latest update downloaded 2 days ago, Acrobat X will no longer function properly and will not open.  What to do?

  • Query regarding hex format in labview

    hello, I am getting hex data in labview in the format xxxx xxxx xxxx xxxx and i am trying to convert it into number format..so is this hex format valid or do i need to remove the spaces between them before conversion to a number?..any help would be a

  • Reinstall on another computer

    I want to buy illustrator СS6, but several times a year I go to another city and I need to reinstall program from the my computer to the my laptop, I can do this? which license should I buy?