Large files are not getting transferred through file channel

Hi
the below code works fine for files upto 32 mb, but if the file size is more like 141MB, 250MB then the transfer starts but it doesnot get complete. the destination pdf is not opening and acrobat reader says that the pdf has been corrupted
import java.beans.*;
import java.io.Serializable;
import java.io.*;
import java.io.File.*;
import java.util.zip.*;
import java.nio.*;
import java.nio.channels.*;
public class Transfer
   public static void main(String args[]){
     String srcFile = "C:\\\\144 mb.pdf";
     String dstFile = "F:\\144 mb.pdf";
     try{
     FileInputStream in = new FileInputStream(srcFile);
        FileOutputStream out = new FileOutputStream(dstFile);
        FileChannel fcin = in.getChannel();
        FileChannel fcout = out.getChannel();
        long size = fcin.size();
        fcin.transferTo(0, size, fcout);
     }catch(Exception e){
}//close of classwhat could be the reason

below is the code that executes as Task1 when triggered as a thread from Class B
public class C implements Runnable{
    String srcFile = "";
    String dstFile = "";   
    public C (String srcFile,String dstFile){
       this.dstFile =  dstFile;
       this.srcFile =  srcFile;
public void run() {              
try
       FileInputStream in = new FileInputStream(srcFile);
       FileOutputStream out = new FileOutputStream(dstFile);
        FileChannel fcin = in.getChannel();
        FileChannel fcout = out.getChannel();          
        int maxCount = 32 * 1024 * 1024;
        long size = fcin.size();
        long position = 0;
        while (position < size) {
            position += fcin.transferTo(position, maxCount,fcout);
          fcin.close();
          fcout.close();
}catch(IOException ioe)
          System.out.println("FIECOPY SQL ERROR:"+ioe);
catch(Exception e)
          System.out.println("FIECOPY  ERROR IN TRANSFER FILE:"+e);
}below is the code that executes as Task2 when triggered as a thread from Class B
public class D implements Runnable{
    String srcFile="";
    String dstFile="";
    String moveCategory="";
    public  D(String srcFile,String dstFile,String moveCategory){
       this.dstFile =  dstFile;
       this.srcFile =  srcFile;
       this.moveCategory = moveCategory;
public void run(){
try
       FileInputStream in = new FileInputStream(srcFile);
       FileOutputStream out = new FileOutputStream(dstFile);
        FileChannel fcin = in.getChannel();
        FileChannel fcout = out.getChannel();
     int maxCount = 32 * 1024 * 1024;
        long size = fcin.size();
        long position = 0;
        while (position < size) {
            position += fcin.transferTo(position, maxCount,fcout);
          fcin.close();
          fcout.close();
}catch(IOException ioe)
          System.out.println("FIECOPY SQL ERROR:"+ioe);
catch(Exception e)
          System.out.println("FIECOPY  ERROR IN TRANSFER FILE:"+e);
}

Similar Messages

  • Changes to Excel files are not getting updated

    File updates not reflected. I modified content, added data validation and saved the file back - next day file is still the way it was before modification.
    Other file, another site but similar situation.
    Content changed - form added but next day the change is not reflected. File updates not reflected. I modified content, added data validation and saved the file back - next day file is still the way it was before modification.
    Other file, another site but similar situation.
    Content changed - form added but next day the change is not reflected.

    Hi,
    According to your post, my understanding is that changes to Excel files are not getting updated.
    I recommend to configure Excel Services data refresh by using Secure Store and an external Office Data Connection (ODC) file.
    For more information, you can refe to:
    Configure Excel Services data refresh by using external data connections in SharePoint Server 2013
    If you use PowerPivot, you can refer to:
    Refreshing PowerPivot Data in SharePoint 2013
    If you use Office Web Apps, you can use New-SPWOPISuppressionSetting -extension xlsx -action view to refresh data.
    You can refer to:
    PowerPivot for SharePoint - Browser Refresh Fails (Data Refresh not supported in Office Web Apps)
    In addition, here is a similar thread for your reference:
    http://social.technet.microsoft.com/Forums/office/en-US/2c4009f3-62bc-4af0-9e16-e40e9d418e3b/user-changes-to-sharepoint-documents-lost
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Files are not getting updated in sharepoint 2013 because of office upload center error

    Dear Team,
    I am getting upload failed/upload error in Office Upload Center.
    Scenario: I opened excel(version is 2013) file from sharepoint 2013 application and closed and after updating. Later when I opened the file I got error like "UPLOAD FAILED We are sorry this didn't work. Try saving again later and if that still doesn't
    work, click save a copy."
    I found the error is because file is getting upload failed / upload error in microsoft office upload center2013. 
    Please let me know if anyone know the solution for my issues
    Thanks in Advance
    Girish

    Hi Girishkg,
    The default IIS limit for the upload file size is 30MB. If the selected files are larger than 30MB, the files are not uploaded.
    The limit can be set in web application’s web.config file or in IIS .
    There are two detailed articles about setting the limit:
    http://www.brainlitter.com/2009/07/13/sharepointcannot-upload-documents-larger-than-30mb-on-windows-server-2008-or-sbs-2008-application-servers/
    http://expectedexception.wordpress.com/2011/02/08/upload-multiple-files-fail-without-error/
    Feel free to reply if the issue still exists.
    Best regards
    Wendy Li
    TechNet Community Support

  • Files are not getting posted in destination directory,how to trace in XI

    Hi,
    our scenario is proxy to file.
    We are posting files of .TRG and .DAT format in destination directory.Due to less space in destination directory, files only .TRG files are getting posted but .DAT are not getting posted.but i have checked in XI system SXMB_MONI,no error message is coming.message is getting processed successfully.
    why it is not visible and to monitor that files are not saved at the destination.
    Is this normal with XI that we can not see of files are really saved?

    Hi,
    > it should generate two files as per scenario but only one file is getting generated due to less space,
    NO.
    If  No  Space, The error will pops  out  in RWB  .
    Check the directory of the File Adapter  you are using
    Regards
    Agasthuri Doss

  • Nohup.log files are not getting generated correctly

    hai,
    im a weblogic administrator. Here is my problem in weblogic. My partner has complained that nohup.logs are not getting generated properly. Like for every 5 mins a new nohup .log file is getting generated. But almost 4 to 5 logs are of 0 size and after that the 6 log file is very hug ( around MB). And the status of the managed servers is in FAILED state. When i checked the nohup logs, i can see "E297: Write Error In Swap File" and also the below error. But when i checked the disk space it is only 30 % full. Please suggest me something that can help me in this. Why is this behavior in the nohup.logs? have anyone faced anythign like this? Please help me.
    But after the recycle everything is fine. But i want to know what went wrong and why it got recovered after the recycle.
    <Feb 11, 2010 7:43:59 AM CST> <Error> <HTTP> <BEA-101246> <Error occurred while flushing HTTP log file for the Web server: wl38_managed1
    java.io.IOException: Disk quota exceeded.
    java.io.IOException: Disk quota exceeded
    at java.io.FileOutputStream.writeBytes([BII)V(FileOutputStream.java:???)
    at java.io.FileOutputStream.write(FileOutputStream.java:260)
    at com.wily.introscope.agent.probe.io.ManagedFileOutputStream.write(ManagedFileOutputStream.java:423)
    at weblogic.utils.io.DoubleBufferedOutputStream.flushBuffer(DoubleBufferedOutputStream.java:58)
    at weblogic.utils.io.DoubleBufferedOutputStream.flush(DoubleBufferedOutputStream.java:157)
    at weblogic.servlet.logging.LogManagerHttp$FlushLogStreamTrigger.trigger(LogManagerHttp.java:522)
    at weblogic.time.common.internal.ScheduledTrigger.run(ScheduledTrigger.java:243)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at weblogic.time.common.internal.ScheduledTrigger.executeLocally(ScheduledTrigger.java:229)
    at weblogic.time.common.internal.ScheduledTrigger.execute(ScheduledTrigger.java:223)
    at weblogic.time.server.ScheduledTrigger.execute(ScheduledTrigger.java:50)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

    according to error message, your partition size have not enough disk space from where you are running nohup command. check with df -kh.

  • OLE images are not getting transfered to the pdf format

    After executing the oracle report file 6i and while sending the report file directly from the report screen to the microsoft outlook mail by clicking the mail option from the report, the OLE Images are NOT getting converted to the mail attachment. Rest of the data is getting converted fine.

    hope this is not the correct forum to place this question.
    if not, mention DB and OS versions and state your problem more clearly
    mark answered post as helpful / correct*

  • File is not getting deleted in File-RFC-File without BPM

    Hi,
    I'm working on File-RFC-File scenario without BPM. Everything is working fine except file is not getting deleted after the process. I'm passing xml file here and in return it will give the xml success/error message from RFC.
    For the sender CC, I'm passing the following parameters,
    Transsport protocol: File system
    Message protocol: File
    QoS: BE
    Poll Interval: 30 sec
    Mode: Delete
    File type: Binay
    Please let me know if I missed anything while passing the values.
    Thanks,
    Swamy
    Edited by: Swamy Mothe on Jun 15, 2009 8:52 AM

    Hi
    Then , is Sender and receiver File Adapter is using same folder )
    Just a question.
    But having all permisions and above config would delete the file
    can u see the status of u r File Adapter in RWB.? Is it in green?
    rgds
    srini

  • HT201269 while transferring data from iphone 3GS to iphone 4S SMS details are not getting transferred.

    While transferring data from old iphone 3gs to new iphone4s through itunes the data in messages is not getting transferred.

    @ melfromvictoria
    Have you tried right clicking on the 4s and select "restore from back up"

  • Buss.Area not getting transferred to invoice list

    Hi Gurus,
    hope u all r doin good outhere, i have an issue with bussiness area not getting populated or transferrred for Invoice list that are released to accounting .
    the scenario here is: in the accounting overview under the Billing Invoice(VF03) we are able to see the buss area against the customer acct line item and the GL acctline item, but when we go into the Accounting overview under Invoice List (VF23), the Buss area is not getting populated against the Customer lineitem..., we are not able to figure out what is missing...is it in the configuration...,
    we are on 4.6 , and we have an OSS note 69499 (given below) on this issue which says
    Summary
    Symptom
    Business areas are not transferred for invoice lists that are released to financial accounting.
    Additional key words
    GSBER TVTA VF21 SAPMV62S factoring discount
    Cause and prerequisites
    This was not programmed
    Solution
    A solution is only available in the standard system as of Release 3.0D.
    You can make the attached advance correction that uses a user exit.
    In this solution, the business area is copied from the sales area table (TVTA) for the sales area of the invoice list header. A business area determination on plant/division level (T134G) is not possible because the item information of the individual billing documents is no longer available in the invoice list.
    Source code corrections
    and we have contacted SAP , some one from SAP side told that the program is existing in that userexit already with our 4.6c,
    someone has suggested that in OB65 the check box is not activated against the comp code i use, but i have found that to be the check mark for the financial statements at the buss area level..will that make any diff to my issue... is it something with the FI part or SD part which do you think is incorrect ....any kind of suggestions pertaining to this issue .here would be helpful.
    some body please throw some light on it, i would be very much grateful.
    Thanks in advance
    Jay

    Hi Laxmipathi sir,
    as you said i went in the bussiness area account assignment and checked it and foound that the Sales area, distributin channel and division are assiogned to rule called 003 -Buss Area Det.from sales org/dist.channel item div.
    but there are other two.which were not assigned.
    001-buss area det.from plant/dividion(T134G)
    002-buss area det.from Sales area (TVTA).
    so do you think this is the reason it is not picking it up in the invoice list,
    i have discussed with one of the SD person here he said even though you don't assign them it shoudn't bother because the buss area is getting picked in invoice
    so could you please tell me what should i ask that person or what i have to tell them about this.
    thanks
    Jay

  • Temporary files are not getting deleted

    Hi All,
    I am using informix database and my code is reading BLOB from database and writing the image to different storage media. The program has to run for number of images. It is writing to media successfully but not exiting even after printing the last statement in program. it is generating some temporary files ifxb_* . If I use System.exit() garbage collection is not happeneing and temporary files not getting deleted.
    I am storing BLOB to an InputStream. and closing all the Connections and ResultSet before exit.
    Can anyone please tell why program is not exiting normally?

    gtRpr wrote:
    It doesn't make much sense to me to go through extra work to make code insecure, when doing things the right way is easier and more secure.@yawmark - I get it, relax.
    I never used them last year because I only found out about there existance about 4 Months ago.
    And guess what I have never used normal statements for something like that again.
    Only time I use a normal Statement is when I run that query only once, and no the entire query is hardcoded so no need for any worries due to security.Um ... D'you post this to the wrong forum/topic?
    Anyway, OP ... I don't know a thing about informix, so perhaps a trip over to IBM would help ... they have lots of information on their site. You might want to try a different forum right here at java.sun.com as well.
    About those closing of Connections and Resultsets ... are they in finally clauses? They should be.
    ~Bill

  • File is not getting transfered in sm35

    Dear Techis
    I m Executin a BDC thru session method bdc is of Tcode fb01 here i had taken maximum possible Combination of postig keys now problem is for some posting key session ws getting created in sm35 with data and for some posting keys session is getting created without any data..
    And wen i tried to combine different posting keys in one flat file session is getting created but with some missing data
    Can anybody pls help me regarding tckle dis issue..
    Rewards for every helpful ans

    Hi,
        I think for different posting keys different no of fields exist.
    So it will be difficult to prepare a flat file.  Since recording varies from posting key to posting key it may not create record .
    Ex : Ifposting key =4 0 and 50 and the amounts are equal then a document number will be generated.
    Rgds
    Umakanth

  • Files are not getting stored in memory card

    mine is lumia 620,i have chosen the mem.card option to save photos and music files.But the files i download are stored in phone memory ,not in memory card although the files are shown in mem.card it shows error while i try to play it in computer.

    hi mate, is your memory card a Class 10 memory card or corrupt? you only need Class 2 or Class 4 memory cards. It would also pay to scan the memory card thru Windows Explorer to see if there are any file system errors, else you can try formatting the memory card on PC and then formatting it on the phone itself.
    as precaution, try performing a soft reset on your 620, and also ensure that you are up to date with the latest firmware and Nokia system app updates from the Store.

  • We are using SAP SRM to punch out external catalogs. Firefox version 3.5 and below works fine and the items from the catalogs are brought back to SRM .But when we use version 3.6.12 the items are not getting transferred back to SRM from the Catalogs.

    SRM is a procurement system from SAP which we use to purchase goods and service. We have external catalogs like officemax, cdw etc which we punchout the items and bring it to SRM for ordering.
    When we use firefox version 3.5 and below the items which we add from the Catalogs are correctly brought back to SRM for us to order. But when we use versions 3.6.12 the items are not brought back to SRM.
    Internet Explorer 7 and 8 works fine. Is there anyway you can help us.
    Thanks
    Jayant

    Hi,
    Firstly I would suggest you to upgrade your database from Oracle Release 11.2.0.1.0 to Oracle Release 11.2.0.2 . This is the recommended Oracle 11g database version  for SAP solutions. Many of your problem will get resolved with it.
    Question 1:
    So my first question would be is there any other suggestions besides adjusting the mentioned parameter above in order to ensure that no work processors going into hang state due to RFCs' occupying it as this issue always happens at the end of the month only when there are massive users accessing it.
    For immediate resolution the approach you have followed is correct viz limiting number of dialog processes for RFC. Secondly you need to analyze why RFC processing takes so much time. You need check which programs are getting executed by those RFC.
    Generate EarlyWatch report for more detailed view
    Question 2:
    My second question is what went wrong with the libttsh11.so file. How could it be 0 size in PRD when no signs of changes had happen to the PRD system. Is this a proven Oracle Bug or something else since I have never encountered anything like this before.
    The libttsh11.so library cannot be found in the related directory.
    Cause
    The file system is mounted using CIO option, but per Note 257338.1 Direct I/O (DIO) and Concurrent I/O (CIO) on AIX 5L, an ORACLE_HOME on a filesystem mounted with "cio" option is not supported.
    Such a configuration will cause, installation, relinking and other unexpected problems.
    Solution
    Disable the CIO option on the filesystem.
    References
    NOTE:257338.1 - Direct I/O (DIO) and Concurrent I/O (CIO) on AIX 5L
    Hope this helps.
    Regards,
    Deepak Kori

  • Hyperlinks from converted excel file are not working after pdf file is moved

    I have created a pdf file from an excel file that has hyperlinks in it. The hyperlinks work fine if the files are all kept in the same exact location as the time they were created. Once the files are moved (i.e. emailed to another user) the hyperlinks no longer work. An error message pops up that the file can not be found. Is there a setting or something that I'm missing in acrobat that allows for the files to be moved, so that the hyperlinks still function properly, after creation

    No settings adjustments.
    The issue is that links, once made, have a specific path (as shown when you view the link's text string).
    When you email the files the person who recieves the email and downloads the attachments would have to have the same layout of files/folders you have.
    Without that links are "broken"
    You email a zip file that, when extracted, would create the folders/files in the required layout to reflect what you have.
    Be well...

  • Flat files are not getting generated in ftp

    Hi Expers
    In my scenario,R/3 system is sending IDOC's to FTP(POS) server,but issue was occured in generating the flat files for 3 articles.
    Can anybody please tell me the steps how to resolve this issue...
    Regards
    Raj

    Hi Ramesh,
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--
    Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="MAPPING">GENERIC</SAP:Code>
      <SAP:P1>com/sap/xi/tf/_IXRIMandPriceToGMStore_</SAP:P1>
      <SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
      <SAP:P3>RuntimeException in Message-Mapping transformatio~</SAP:P3>
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>com/sap/xi/tf/_IXRIMandPriceToGMStore_com.sap.aii.utilxi.misc.api.BaseRuntimeExceptionRuntimeException in Message-Mapping transformatio~</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    This is the error message i am getting in Moni...Could u please suggest me in this..
    Regards
    Raj

Maybe you are looking for