FTP and "File-in-use"

Dear all,
We have a scenario in which a file is written to the SAP application server which should be picked up by XI using the FTP adapter. The polling interval of the adapter is set to 60 seconds.
We running into a strange problem: it may occur that the program on the SAP application server is still busy writing the dataset to the server, however the file already exists (as soon as the OPEN DATASET statement is passed the file is created on the application server but with no content yet). If just at this time the interval of 60 seconds is passed the FTP-adapter picks up the empty file, does no processing because the file is empty, but still archives the file to an archive directory.
Obviously the OPEN DATASET does not put an exclusive lock to the file? Does anyone know a solution to this?
Kind regards,
John.

Hi,
use .tmp extension to the file untill it completes writing the data, then change it to original extension.
for eg: if it is a .txt file then use .tmp untill the file is written and then change it to .txt this is not a big logic at SAP, just renaming the file after completing the write.
Regards,
Karan.

Similar Messages

  • Using JCA FTP and File Adapters to transfer files as attachments

    I am trying to develop a flow that picks a file up using the JCA FTP adapter and writes it using the JCA File Adapter. I can get this to work using opaqeElement but the issue I have is that the files that will be transferred are regularly very large > 1 GB and using the opaqueElement simply results in a OutOfMemoryException.
    Reading the Adapter documentation it seems that Reading/Writing file as an attachment may be an answer. I therefore did the following.
    . Created FTP Read and File Write adapters in JDeveloper
    . Inmported this in to OEPE
    . Created Proxy Service and Business Service and wired them together
    The problem i am having is that even though there is no error and the file is being read on the FTP server, the resulting file only contains that attachment details, the file is not a copy of the file that was picked up from the ftp server.
    I am assuming that this behaviour is not correct and that the file should be transferred in its entirity. Unfortunatly the documentation is not very detailed and I cannot find any examples on the internet.
    Can anyone offer any advice or even better suggest where I can find an example.
    Regards
    My JCA adapters are as follows:
    FileWriteAsAttachmentAdapter_file
    <adapter-config name="FileWriteAsAttachmentAdapter" adapter="File Adapter"
         wsdlLocation="FileWriteAsAttachmentAdapter.wsdl"
         xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
    <connection-factory location="eis/HAFileAdapter"/>
    <endpoint-interaction portType="Write_ptt" operation="Write">
    <interaction-spec className="oracle.tip.adapter.file.outbound.FileInteractionSpec">
    <property name="PhysicalDirectory" value="C:\fileserver\download\toprocess"/>
    <property name="Append" value="false"/>
    <property name="FileNamingConvention" value="attachment_%SEQ%.csv"/>
    <property name="NumberMessages" value="1"/>
    </interaction-spec>
    </endpoint-interaction>
    </adapter-config>
    FileWriteAsAttachmentAdapter.wsdl
    <wsdl:definitions
    name="FileWriteAsAttachmentAdapter"
    targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/file/AtatchmentApp/Project1/FileWriteAsAttachmentAdapter"
    xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/file/AtatchmentApp/Project1/FileWriteAsAttachmentAdapter"
    xmlns:imp1="http://xmlns.oracle.com/pcbpel/adapter/file/attachment/"
    xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    >
    <plt:partnerLinkType name="Write_plt" >
    <plt:role name="Write_role" >
    <plt:portType name="tns:Write_ptt" />
    </plt:role>
    </plt:partnerLinkType>
    <wsdl:types>
    <schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/file/attachment/" xmlns="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified" >
    <element name="attachmentElement" >
    <complexType>
    <attribute name="href" type="string" />
    </complexType>
    </element>
    </schema>
    </wsdl:types>
    <wsdl:message name="Write_msg">
    <wsdl:part name="body" element="imp1:attachmentElement"/>
    </wsdl:message>
    <wsdl:portType name="Write_ptt">
    <wsdl:operation name="Write">
    <wsdl:input message="tns:Write_msg"/>
    </wsdl:operation>
    </wsdl:portType>
    </wsdl:definitions>
    FtpGetAsAttachmentAdapter_ftp.jca
    <adapter-config name="FtpGetAsAttachmentAdapter" adapter="FTP Adapter"
         wsdlLocation="FtpGetAsAttachmentAdapter.wsdl"
         xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
    <connection-factory location="eis/ftp/TlmsHAFtpAdapter"/>
    <endpoint-activation portType="Get_ptt" operation="Get">
    <activation-spec className="oracle.tip.adapter.ftp.inbound.FTPActivationSpec">
    <property name="AsAttachment" value="true"/>
    <property name="DeleteFile" value="true"/>
    <property name="MinimumAge" value="300"/>
    <property name="PhysicalDirectory" value="/ftp/tlms2atas"/>
    <property name="Recursive" value="false"/>
    <property name="FileModificationTime" value="FileSystem"/>
    <property name="PollingFrequency" value="60"/>
    <property name="FileType" value="ascii"/>
    <property name="IncludeFiles" value=".*[_][0-9][0-9][-][0-9][0-9][-][0-9][0-9][_].*\.csv"/>
    <property name="UseHeaders" value="false"/>
    <property name="ModificationTimeFormat" value="dd/MM/yyyy HH:mm"/>
    </activation-spec>
    </endpoint-activation>
    </adapter-config>
    FtpGetAsAttachmentAdapter.wsdl
    <wsdl:definitions
    name="FtpGetAsAttachmentAdapter"
    targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/ftp/AtatchmentApp/Project1/FtpGetAsAttachmentAdapter"
    xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/ftp/AtatchmentApp/Project1/FtpGetAsAttachmentAdapter"
    xmlns:attach="http://xmlns.oracle.com/pcbpel/adapter/file/attachment/"
    xmlns:pc="http://xmlns.oracle.com/pcbpel/"
    xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    >
    <plt:partnerLinkType name="Get_plt" >
    <plt:role name="Get_role" >
    <plt:portType name="tns:Get_ptt" />
    </plt:role>
    </plt:partnerLinkType>
    <wsdl:types>
    <schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/file/attachment/" xmlns="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified" >
    <element name="attachmentElement" >
    <complexType>
    <attribute name="href" type="string" />
    </complexType>
    </element>
    </schema>
    </wsdl:types>
    <wsdl:message name="Get_msg">
    <wsdl:part name="attach" element="attach:attachmentElement"/>
    </wsdl:message>
    <wsdl:portType name="Get_ptt">
    <wsdl:operation name="Get">
    <wsdl:input message="tns:Get_msg"/>
    </wsdl:operation>
    </wsdl:portType>
    </wsdl:definitions>

    System resources are finite and have a threshold limit for processing. The Oracle SOA Suite, dependent on system resources, also has certain size limitations, largely due to the underlying resources beyond which the system cannot process incoming requests.
    For example, Oracle JCA Adapters can process large payloads but the Oracle BPEL PM consumes huge memory when processing large payloads, which can cause OutOfMemory conditions and affect the whole system.
    You can try File ChunkedRead option.This will read your large CSV file in chunks so chances of memory out will be less. You can define your own chunk size.
    This is a feature of Oracle File and FTP Adapters that uses an invoke activity within a while loop to process the target file. This feature enables you to process arbitrarily
    large files. See below link's section "4.5.5 Oracle File Adapter ChunkedRead"
    http://www.orastudy.com/oradoc/selfstu/fusion/integration.1111/e10231/adptr_file.htm#BABDIABG
    Thanks,
    Ashu

  • Sapevt and file adapter using ftp

    Hi;
    Using the file adapter, I ftp a file to our SAP R/3 system called T01 (=SID).
    Target directory
    //T01/010/OCS/TC/IN
    File name scheme:
    wka.dat
    I specify in "Run Operating System Command After Message Processing"
    sapevt WKA -t name=T01 nr=01
    WKA is the event I defined (SM62) into our T01 R/3 system.
    It seems not to work. Any help? Did I miss something?
    Where do I need to search for logging (ABAP or J2EE stack)?
    Wilbert

    Hi Wilbert,
    Please check these...
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    FTP ReceiverChannel and OS commands help
    Hope these help!
    cheers,
    Prashanth
    P.S Please mark helpful answers

  • Ftp and File polling

    Hi
    Do anyone have sample code for file polling.
    i am using linux environment.
    If any client ftp a file i have to poll the file and parse the file csv , if file is parsed and good then send to oracle database and archive the file.
    I have to do everything java
    if one had done this kind of application, send me the sample code.
    Thanks in advance
    sami

    Actually client using any ftp client programm and send or ftp a file on the my ftp server from there i have to check which file is new for every 1hour and i have to take that file, parse (csv parse) and insert the data to oracle database and archive the file, if file is good otherwise i have to send email to some dept saying file is bad.
    could u have any idea or sample code.
    Thanks
    sami

  • Save the files of my HDD, please. (Extremely slow: 0,05 Mb/s and "file in use").

    Hi all,
    This is probably the first time ever that I have to ask a question myself. Usually when I have any problems I can find a solution in other people's solved threads. But not this time and I'm really frustrated. If any of you can help me with this I will be eternally grateful.
    I have a 1TB WD external hard drive with 500Gb of millions of files, really important data that is not copied anywhere else right now.
    Around the time I upgraded to Maverick's I think (not 100% sure) I started having problems when I wanted to copy files from the HDD. Some files would randomly give the error "The operation can’t be completed because the item X is in use". Some not, but since I have millions of files, I would try to copy folders, and whenever one of these files gave an error, the whole operation would be canceled and all the copied files deleted. Copying one by one is not an option, especially because there are some that don't even work individually, maybe 1/3 of them, I don't know.
    I started looking on the internet about the problem and I found many people having the same one. However, they circumstances were usually different, not wanting to copy from an external HDD, but maybe they just wanted to delete some file or talking about some network thing saying some terms that I don't understand like NAS, SMB shares, AFP, so I thought that that wasn't my case. For the ones whose circumstances were similar, I tried every single option that I found. Here is what I tried so far:
    -Copying not the files but the "mother/s folder/s (in many different ways and it definitely didn't solve anything).
    -Killing some process called "Unmount blabla" I don't remember.
    -Disabling the icon preview in finder. I thought it would solve it because everyone said it did, but not for me : (
    Note that so far, while I couldn't copy the files, the speed at which it tried or it copied some was a normal one.
    Then I went to disk utility and tried to repair the disk, thinking something was wrong with it. The first time I could verify, but not repair. It didn't solve anything obviously. The second time I couldn't even verify it.
    Then I decided to upgrade to Yosemite thinking this might solve a possible Maverick's problem.
    My God, it didn't. Now, not only it keeps saying that the files are in use. Now every time I plug the HDD, it takes around 15 minutes without recognising it, until finally a message pops up "This disk can't be repaired. You can still copy files from it, but backup as many as you can and then erase the volume". (It seems it automatically tries to repair it now?)
    As if that wasn't enough, once the device is recognised. It seems that the speed at which it reads the files inside has been dramatically decreased. If I try now to copy some files. Like an iPhoto Library of 4 Gb, it copies at approximately 0,05 Mb per second, with an estimated time of 24 hours for 4 mere Gb. It would take a whole year to transfer 500Gb. But of course, not even that since after waiting one hour, it gives the same problem "file in use".
    It seems to be more the reading than the writing since when I copy big files that are not in populated folders (and that are not the "evil / in use" files) it does it faster.
    Erasing is not an option, there are just too many important things. I know, I should have had 2 copies, but this is the situation now...
    I tried downloading a recovery software and I tried with some Stellar Phoenix Data Recovery or something like that. The first times I tried recovering files from it, it would do it at the same ultra slow speed. One of the times, randomly it copied all the files at a normal USB 3.0 speed (I had forgotten how fast that was), but all the files were completely unreadable. When I tried to open them it said they were damaged.
    However, it's not that the files are damaged because when I try to copy them manually they can be opened normally. But of course, at the slowest speed in the world and only a fraction of them.
    If you can help me solve this issue, I really would be in debt forever. I haven't end up in a dead end like now and I really need to recover the data.
    Thank you so much in advance.
    Jose

    Get rid of Trusteer. It doesn’t work well under Mac OS.
    Trusteer Rapport Uninstall
    Activity Monitor - Mavericks  also Yosemite
    Activity Monitor in Mavericks has significant changes
    Performance Guide
    Why is my computer slow
    Why your Mac runs slower than it should
    Slow Mac After Mavericks
    Things you can do to resolve slowdowns  see post by Kappy

  • FTP and File problems

    I have Dreamweaver 8. Trying to manage a little league
    website- not real computer savvy.
    All of the files an folders in my panel group (right hand
    column) are gone. Any idea on how I might get that back. I now have
    to go up to 'file' drop down menu, choose 'open' and all folders
    and file names are listed. Much easier when they were all on the
    right column. Have no idea why they are gone.
    I am also now getting a message everytime I try to update
    something........ " FTP error occurred, cannot make connection to
    host. Your login or password is incorrect". I am putting in the
    correct password.
    I recently updated to Windows Exp 7.0 and wonder if that had
    anything to do with this program changing.
    Thanks
    Karen

    > I recently updated to Windows Exp 7.0 and wonder if that
    had anything to
    > do
    > with this program changing.
    Yes - probably did. There are hundreds of posts here about
    issues after
    installing IE7. Have you updated to DW 8.0.2? Please do that
    before doing
    anything else.
    Then, you need to create a new site definition for your site.
    Clearly your
    current definition has become hosed. That's a simple thing to
    do.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "kwilson333" <[email protected]> wrote in
    message
    news:elhplt$2m0$[email protected]..
    >
    >
    > I have Dreamweaver 8. Trying to manage a little league
    website- not real
    > computer savvy.
    >
    > All of the files an folders in my panel group (right
    hand column) are
    > gone.
    > Any idea on how I might get that back. I now have to go
    up to 'file' drop
    > down
    > menu, choose 'open' and all folders and file names are
    listed. Much
    > easier
    > when they were all on the right column. Have no idea why
    they are gone.
    >
    > I am also now getting a message everytime I try to
    update
    > something........ "
    > FTP error occurred, cannot make connection to host. Your
    login or
    > password is
    > incorrect". I am putting in the correct password.
    >
    > I recently updated to Windows Exp 7.0 and wonder if that
    had anything to
    > do
    > with this program changing.
    >
    > Thanks
    > Karen
    >

  • Browsing is very slow on Mac Mini connected to 100mbit LAN. FTP and file download is very fast.

    Hi all
    I have a strange behaviour of my Mac MIni 2012. The mini is connected to the internet by LAN. When I download a file via http or ftp everything is very fast (arround 95mbit/s). But when I try to open a website in Safari, Chrome or Firefox i have to wait some seconds until the page starts rendering.after the page is rendered completely, everything works fast and smooth.
    Do you have any ideas where the problem migth be? I have reinstalled Mavericks from zero yesterday. The problem resists. With my Macbook Air (conntected to the same router) and my Windows computer I dont have this problem.
    THanks in advance for your help.
    Greets
    Marc

    By any chance, do you run sophos?  I had the same issue as you and fixed it on my mac mini and macbook pro by doing the following:
    Sophos --> Open Preferences --> Web Protection --> General
    You will need to enter your admin password after clicking the padlock in the bottom left to allow you to change settings.
    From there, deactivate "Block access to malicious websites using realtime URL reputation checks".  For good measure, I also deactivated "Block malicious downloads from websites".
    Hope this helps!

  • Pure-ftp and file ownership

    Hello,
    I am running a oes2 server with pure-ftp. Everything is running fine with pure-ftp when login in with FileZilla or ftp command line, but I als have a ncp volume mapped to the ftp location on the server. When people in my organization put files in the ftp directories via the ncp connections ownership of the files will be of those who put them there and not the ownership of the ftp user which owns the ftp directory on the server.
    Is it possible to configure the server/pure-ftp or ncp to change the ownership of the file from edit user to ftp user.
    Regards

    I will answer from the pure-ftpd perspective: There is not anything pure-ftpd can do to solve this issue.
    You could develop a cron script that would frequently traverse these directories and chown the file according to your desires.
    I don't have much experience on the NCP side, but if your real concern about ownership is that someone else needs permissions, then maybe setting a different umask in the NCP volume settings would grant more permissions to more people, and solve your issue that way.

  • Print and file sharing used to work...

    First off, Windows XP, Linksys wireless wrt54g version 2, One desktop connected to the router wired, one laptop, wireless Linksys wireless card. Firmware is updated to most current version, wep encripted.
    I used to be able to share files between the 2 computers and print from my laptop wirelessly if the desktop computer was on. I've always shared had the internet connection working, and it still does work just fine, but the file sharing and print sharing no longer do. It allows me to see the other computer connected to the router, but will not let me connect to the other computer. I get an error message, I'll post a pic of that. Nothing has changed, it just stopped working. I also have turned off both of the MS firewalls in attempt to get this to work, and that didn't help.
    Both computers are virus and spyware free, AVG antivirus, adaware-se and spybot search and destroy, along with spywareblaster are always run and updated,

    Just a quick follow up.
    I ran into the same problem and for two nights straight it drove me nuts. After reading this post about the firewall I decided to do some investigating.
    All firewall software applications have a option to add a range of secure I.P. address. You must enter the range that the router gives you. 192.168.1.100-200 etc. My old router used a 192.168.2.1 and this messed me up.
    After entering the new info, file print sharing was good to go.
    Mcafee
    Personal Firewall Plus
    Options
    Trusted @ Banned I.P.

  • I want to use iChat video and file sharing with Windows users

    Nowadays, iChat is compatible with AOL/AIM, Google Talk, Jabber, Mac.com and MobileMe instant messaging services. I know that Yahoo Messenger support will be available soon in Mac OS X Lion.
    I tried using AOL/AIM and Google Talk natively in iChat in order to talk with Windows users which were using Google Talk application or web chatting (Me from: Google Talk - My friends from:  Google Talk, and Me from: AOL/AIM - My friends from:  Google Talk), but videoconference and file sharing were not available.
    I also tried Windows Live Messenger in iChat via Jabber intermediate, but it is not efficient and doesn't work for videoconference and file sharing.
    So, which IM service combination I should use to chat with Windows users in order to be able to use videoconference and file sharing using such a great app like iChat?
    Thanks you.

    Hi,
    A lapsed Trial or lapsed Paid for MobileMe account will not work in any fashion, as a Screen Name in iChat/AIM apps or as a Email.  (Of course it is no longer an Valid Apple ID either).
    Given that Google is a Jabber server iChat will Video (or Audio Only) Chat Jabber to Jabber.
    With a Valid AIM name (AIM, MobileMe or @mac.com) then it is supposed to work to AIM on a PC
    This tends to vary from person to person as to success.
    From AIM version 6.5 AIM introduced a Send as Typing feature called "Real Time"
    It does not work to iChat and in fact also has to be turned Off in the Buddy List at the AIM end for Video or Audio chats to work.
    The AIM app also has to be allowed through the Windows Firewall as an Exception, preferably with UPnP enabled as well and UPnP enabled in their Router.
    Trillian is a paid for App for PCs that provide an alternative.
    Recently theri site offered 3 windows versions
    The Pro version of verion 3.2 (known to work), a version 4 and a version 5 in beta.  The version 3.2 used to have a free Text chat version and only the Pro version was needed to Video.
    Until the site was reorganised the 3.2 version was "On Sale" at a reduced price.
    It seems version 5 is now out of beta
    They are still separating out a Pro version.
    It is a multi-service client
    There is also a Mac version although I have not tried it.
    I am not sure what you mean by "Manage" your MSN Contacts.
    How about using a MobileMe expired account screen name for using iChat with Windows-Google Talk users? Should I expect the same incompatibilities?
    I have already addressed part of this. The fact the name will not work full stop.
    However one way of reading this is that you are thing of linking AIM and Jabber (Google) Buddies in one Buddy List
    Directly in iChat this cannot be done - unless you are the one with the Jabber Account and an AIM Transport set up.
    You would be subject to the same Text Chat only restrictions.
    It is a bit like the fact your phone line can be used for Fax, Telephone and DSL broadband. (in fact mine does TV as well)
    You granny would not be able to talk to your Fax machine if that happened to answer the call.
    Her Fax machine might be able to communicate with your computer if you had an active Fax app on there, and a dail-up modem active to answer.
    10:06 PM      Tuesday; May 24, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.7)
     Mac OS X (10.6.7),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Multipart/form-data and file attachment

    Hi ,
    This question has probably been asked before, but if not then here it is. Any replies will be appreciated:
    Q. When using "Enctype=Multipart/form-data", with file attachment alongwith other form fields, is it mandatory to attach a file ? What if user selects no file to attach?
    Q. If no, then how can it be possible that a form can be submitted without attaching a file since when I try to submit a form with no file attached to it, it gives me error message saying :java.lang.NullPointerException
    Q. Does it mean that I can't have a form with a blank "File" input field, if the form's Enctype is "multipart/form-data"? Since users may not select a file to attach to the form, in other words it is an optional.
    I hope I was clear enough in explaining my questions.
    Thanks in advance.

    I am using Orielly's file attachement pacakge.
    Here's what I am doing in my JSP page: It does the following:
    int maxFileSize = 10 * 1024 * 1024; // 5MB max
    String uploadDir = "/direct/files/upload/";
    String FormResults = "";
    String FileResults = "";
    String fileName = "";
    String fileName2 = "";
    String paramName="";
    String paramValue="";     
    File f;
    int filecounter=1;
    first get the form fields using following code:
    MultipartRequest multi = new MultipartRequest(request, uploadDir, maxFileSize);
    Enumeration params = multi.getParameterNames();
    //Get the form information
    while (params.hasMoreElements())
         paramName = (String) params.nextElement();     
         paramValue = multi.getParameter(paramName);
         if (paramName.equals("emailconfirm"))
              emailconfirmation = paramValue;
         else if (paramName.equals("Requester"))
              Requester = paramValue;
         else if (paramName.equals("TodaysDate"))
              TodaysDate = paramValue;
         else if (paramName.equals("Extension"))
    }//end while
    Then it gets the file information using the following code: I have two file fields in my form so that's why I am using a filecounter to find out if user has attached two files or just one:
    Enumeration files = multi.getFileNames();
    while (files.hasMoreElements())
         String formName = (String) files.nextElement();
         if (filecounter == 2)
    fileName2 = multi.getFilesystemName(formName);
         String fileType = multi.getContentType(formName);
              f = multi.getFile(formName);
         FileResults += "<BR>" + formName + "=" + fileName2 + ": Type= " + fileType + ":
    Size= " + f.length();
         else
         {     fileName = multi.getFilesystemName(formName);
              String fileType = multi.getContentType(formName);
              f = multi.getFile(formName);
              FileResults += "<BR>" + formName + "=" + fileName + ": Type= " + fileType + ":
    Size= " + f.length();
         filecounter=filecounter+1;
    Then after composing the mail message I send email with the form fields and file attachments using following code:
    Properties props = new Properties();
    MimeBodyPart mbp1 = new MimeBodyPart();
    MimeBodyPart mbp2 = new MimeBodyPart();
    MimeBodyPart mbp3 = new MimeBodyPart();
    URLDecoder urlDecoder = new URLDecoder();
    String to1 = urlDecoder.decode(toemail);
    String from1 = urlDecoder.decode(fromemail);
    String cc1 = urlDecoder.decode(ccemail);
    props.put( "mail.host", host );
    Session session1 = Session.getDefaultInstance(props, null);
    // Construct the message
    Message msg = new MimeMessage( session1 );
    msg.setFrom( new InternetAddress( from1 ) );
    msg.setRecipients( Message.RecipientType.TO, InternetAddress.parse( to1, false ) );
    msg.setRecipients( Message.RecipientType.CC, InternetAddress.parse( cc1, false ) );
    msg.setSubject( subject );
    msg.setHeader( "X-Mailer", "ExceptionErrorMail" );
    msg.setSentDate( new Date() );
    mbp1.setText(mail_message);
    mbp1.setContent(mail_message, "text/html");
    // Send the email message
    FileDataSource fds = new FileDataSource(uploadDir + fileName);
    FileDataSource fds2 = new FileDataSource(uploadDir + fileName2);
    mbp2.setDataHandler(new DataHandler(fds));
    mbp3.setDataHandler(new DataHandler(fds2));
    mbp2.setFileName(fileName);
    mbp3.setFileName(fileName2);
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp1);
    mp.addBodyPart(mbp2);
    mp.addBodyPart(mbp3);
    msg.setContent(mp);
    Transport.send( msg );
    //email sent...
    //delete the two files from the server..
    File f2 =new File(uploadDir + fileName);
    f2.delete();
    File f3 =new File(uploadDir + fileName2);
    f3.delete();     
    //End of code
    So when I don't attach a file and submit my form , I get the error message that I mentioned in my previous post.
    Any more ideas?

  • File transfering using Sockets

    can anybody help me to find the simple sample code for file transfering. i m new to java and having problem in client server assignment. sending message (chatting) is done, but i still need file transfering part. only one file at one time is good enough.
    thanks.
    moe

    Since you're asking for help with your homework, I won't give you any code but I will point you in the right direction. Sockets can be used to stream data and files also use sockets. If you put the two together, you'll be able to stream your files between JREs.
    Shaun

  • How to FTP a file from client machine to database server using forms 10g

    Hi
    I want to ftp a file from a client machine to the database server machine using forms 10G (or PL/SQL).
    could you please tell me how can I do this
    Regards

    hi
    How to get up and running with WebUtil 1.06 included with Oracle Developer Suite 10.1.2.0.2 on a win32 platform
    Solution
    Assuming a fresh "Complete" install of Oracle Developer Suite 10.1.2.0.2,
    here are steps to get a small test form running, using WebUtil 1.06.
    Note: Oracle_Home is used as an alias for your real oDS ORACLE_HOME.
    Feel free to copy this note to a text editor, and do a global find/replace on
    Oracle_Home with your actual value (no trailing slash). Then it is easy to
    copy/paste actual commands to be executed from the note copy.
    1) Download http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip
    and extract to a temporary staging area. Do not attempt to use 1.7 or 1.9.
    2) Copy or move jacob.jar and jacob.dll
    C:\webutile is the folder where you extracted Jacob, and will end in ...\jacob_18
    cd C:\webutile
    copy jacob.jar Oracle_Home\forms\java\.
    copy jacob.dll Oracle_Home\forms\webutil\.
    The Jacob staging area is no longer needed, and may be deleted.
    3) Sign frmwebutil.jar and jacob.jar
    Open a DOS command prompt.
    Add Oracle_Home\jdk\bin to the PATH:
    set PATH=Oracle_Home\jdk\bin;%PATH%
    Sign the files, and check the output for success:
    Oracle_Home\forms\webutil\sign_webutil Oracle_Home\forms\java\frmwebutil.jar
    Oracle_Home\forms\webutil\sign_webutil Oracle_Home\forms\java\jacob.jar
    4) If you already have a schema in your RDBMS which contains the WebUtil stored code,
    you may skip this step. Otherwise,
    Create a schema to hold the WebUtil stored code, and privileges needed to
    connect and create a stored package. Schema name "WEBUTIL" is recommended
    for no reason other than consistency over the user base.
    Open Oracle_Home\forms\create_webutil_db.sql in a text editor, and delete or comment
    out the EXIT statement, to be able to see whether the objects were created witout
    errors.
    Start SQL*Plus as SYSTEM, and issue:
    CREATE USER webutil IDENTIFIED BY [password]
    DEFAULT TABLESPACE users
    TEMPORARY TABLESPACE temp;
    GRANT CONNECT, CREATE PROCEDURE, CREATE PUBLIC SYNONYM TO webutil;
    CONNECT webutil/webutil@rcci
    @Oracle_Home\forms\create_webutil_db.sql
    -- Inspect SQL*Plus output for errors, and then
    CREATE PUBLIC SYNONYM webutil_db FOR webutil.webutil_db;
    Reconnect as SYSTEM, and issue:
    grant execute on webutil_db to public;
    5) Modify Oracle_Home\forms\server\default.env, and append Oracle_Home\jdk\jre\lib\rt.jar
    to the CLASSPATH entry.
    6) Modify Oracle_Home\forms\server\formsweb.cfg insde [default] add :
    archive_jini=frmall_jinit.jar,frmwebutil.jar,jacob.jar
    archive=frmall.jar
    also add :
    [webutil]
    WebUtilLogging=off
    WebUtilLoggingDetail=normal
    WebUtilErrorMode=Alert
    WebUtilDispatchMonitorInterval=5
    WebUtilTrustInternal=true
    WebUtilMaxTransferSize=16384
    baseHTMLjinitiator=webutiljini.htm
    baseHTMLjpi=webutiljpi.htm
    baseHTML=webutilbase.htm
    archive_jini=frmall_jinit.jar
    WebUtilArchive=frmwebutil.jar,jacob.jar,f90all.jar
    archive=frmwebutil.jar,f90all.jar
    lookAndFeel=oracle
    7) Modify Oracle_Home\forms\server\webutil.cfg and add :
    transfer.database.enabled=TRUE
    transfer.appsrv.enabled=TRUE
    8) Start the OC4J instance
    9) Start Forms Builder and connect to a schema in the RDBMS used in step (4).
    Open webutil.pll, do a "Compile ALL" (shift-Control-K), and generate to PLX (Control-T).
    It is important to generate the PLX, to avoid the FRM-40039 discussed in Note 303682.1
    If the PLX is not generated, the Webutil.pll library would have to be attached with
    full path information to all forms wishing to use WebUtil. This is NOT recommended.
    10) Create a new FMB.
    Open webutil.olb, and Subclass (not Copy) the Webutil object to the form.
    There is no need to Subclass the WebutilConfig object.
    Attach the Webutil.pll Library, and remove the path.
    Add an ON-LOGON trigger with the code
    NULL;
    to avoid having to connect to an RDBMS (optional).
    Create a new button on a new canvas, with the code
    show_webutil_information (TRUE);
    in a WHEN-BUTTON-PRESSED trigger.
    Compile the FMB to FMX, after doing a Compile-All (Shift-Control-K).
    11) Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if
    the "Application Server URL" is empty.
    Then append "?config=webutil" at the end, so you end up with a URL of the form
    http://server:port/forms/frmservlet?config=webutil
    12) Run your form.

  • Need help with a simple process with FTP Adapter and File Adapter

    I am trying out a simple BPEL process that gets a file in opaque mode from a FTP server using a FTP adapter and writes it to the local file system using a File Adapter. However, the file written is always empty (zero bytes). I then tried out the FTPDebatching sample using the same FTP server JNDI name and this work fine surprisingly. I also verified by looking at the FTP server logs that my process actually does hit the FTP server and seems to list the files based on the filtering condition - but it does not issue any GET or RETR commands to actually get the files. I am suspecting that the problem could be in the Receive, Assign or Invoke activities, but I am not able identify what it is.
    I can provide additional info such as the contents of my bpel and wsdl files if needed.
    Would appreciate if someone can help me with this at the earliest.
    Thanks
    Jay

    persiandude wrote:
    Topic: Need help with if, else, and which statements and loops.
    How would I display 60 < temp. <= 85 in java
    System.out.println("60 < temp. <= 85 in java");
    another question is how do I ask a question like want to try again (y/n) after a output and asking that everytime I type in yes after a output and terminate when saying No.Sun's [basic Java tutorial|http://java.sun.com/docs/books/tutorial/]
    Sun's [New To Java Center|http://java.sun.com/learning/new2java/index.html].Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    [http://javaalmanac.com|http://javaalmanac.com]. A couple dozen code examples that supplement [The Java Developers Almanac|http://www.amazon.com/exec/obidos/tg/detail/-/0201752808?v=glance].
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's [Thinking in Java|http://mindview.net/Books/DownloadSites] (Available online.)
    Joshua Bloch's [Effective Java|http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_1?ie=UTF8&s=books&qid=1214349768&sr=8-1]
    Bert Bates and Kathy Sierra's [Head First Java|http://www.amazon.com/exec/obidos/tg/detail/-/0596004656?v=glance].
    James Gosling's [The Java Programming Language|http://www.bookpool.com/sm/0321349806].

  • FTP and HTTP large file ( 300MB) uploads failing

    We have two IronPort Web S370 proxy servers in a WCCP Transparent proxy cluster.  We are experiencing problems with users who upload large video files where the upload will not complete.  Some of the files are 2GB in size, but most are in the hundreds of megabytes size.  Files of sizes less than a hundred meg seem to work just fine.  Some users are using FTP proxy and some are using HTTP methods, such as YouSendIt.com. We have tried explict proxy settings with some improvment, but it varies by situation.
    Is anyone else having problems with users uploading large files and having them fail?  If so, any advice?
    Thanks,
       Chris

    Have you got any maximum sizes set in the IronPort Data Security Policies section?
    Under Web Security Manager.
    Thanks
    Chris

Maybe you are looking for