File Transfer error - stops at 26280 bytes.

I am trying to make a little file transfer utility, and it works when I test the client and server sides on the same machine, but when I began to test the client and server on different machines it starts giving me problems. For files under 26280 bytes the file transfers completely, no problems. But for anything over that amount, the server stops the transfer and returns a bunch of errors on the server side. The client thinks the file is complete and quits. I am pretty sure it has something to do with the way I have set up the Streams. Here is the code snippit:
For Server:
OutputStream os = socket.getOutputStream();
     BufferedOutputStream bos = new BufferedOutputStream(os);
File nFile = filename;
long long_size = nFile.length();
int size = (int)long_size;
byte[] buffer = new byte[size];
FileInputStream fis = new FileInputStream(nFile);
DataInputStream dis = new DataInputStream(inStream);
while(fis.read(buffer)!=-1){
bos.write(buffer);
bos.flush();
For Client:
InputStream is = sock.getInputStream();
BufferedInputStream bis = new BufferedInputStream(is);
FileOutputStream fos = new FileOutputStream(file);
BufferedOutputStream bosfile = new BufferedOutputStream(fos);
while(true) {
size = bis.available();
if(size == 0)
break;
byte[] pOutput2 = new byte[size];
rc=bis.read(pOutput2, 0, size);
if(rc == -1)
break;
bosfile.write(pOutput2);
if(rc < size)
count +=rc;
break;
else
count +=size;
Any help would be much appreciated. Thank you very much

Doubtful code:
size = bis.available();
if(size == 0)
break;
You have a buffered input stream hanging on a socket input stream. So what if the client gets ahead of the server? Answer: for a while, there is no data available.

Similar Messages

  • File Transfer Error Between Ichat 2.1 and Ichat 3

    I am trying to send my brother some files. He has an Ibook G4 and so do I. He is running Ichat 3 on Tiger and I am running Ichat 2.1. Both of us are using a wireless connection through our own personal cable modems. He can send me files and I can accept them and get them without problems. Every time I try to send him a file, before it starts, we get an error 'File Transfer Error' file name not transferred.
    He says he has no problems receiving files from other buddies of all different types of operating systems.
    I don't recall having any problems sending or receiving from any of my other buddies either.
    Is this just an OS X.3 vs OS X.4 issue? Or is there something weird with my Ibook?
    Has anyone else had this problem? Thanks,
    -Chris
    IBook G4 1 Ghz   Mac OS X (10.3.9)   640 MB RAM

    Hi cjmagnuss,
    Can your brother send files to other people.
    It sounds like it might be his end.
    File Transfers happen on Port 5190 on the UDP protocol.
    Some modems and router have problems if they have to list Protocols when Port Forwading.
    Is this the case for him ?
    10:00 AM Tuesday; February 21, 2006
    iChat Resouce Web pages

  • File Transfer Error / Checked out access

    I am getting a file transfer error when trying to upload a revised file to the Remote Server. I think it may be related to the file being checked out by another team member who no longer has access to Dreamweaver. How can this be resolved? This is on a PC - I have CS6, the team member was using CS4.

    See if this helps
    Dreamweaver Help | Checking in and checking out files
    May not work, but did you try renaming or deleting the locked file?
    Can you log in as the other fomer team member?

  • Remote Execute and File Transfer Error

    Whenever we try to do a Remote Execute of File Transfer, we get an 1899
    error. Here's the strange thing, we can RE and FT to desktops that are
    still running the ZfD 4.x client. Seems to be only happening on the latest
    (ZfD 6.5sp2). Any ideas? Also, remote control and remote view still work
    w/o problem.

    Blewis,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp
    - Check all of the other support tools and options available at
    http://support.novell.com.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://support.novell.com/forums)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://support.novell.com/forums/faq_general.html
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • File transfer error 36

    Trying to transfer files between iMac and iPod classic 60GB (model circa 2005).  The file transfer process begins without problem until I get the following error for a file.  When I open the source document(s) they display just fine.  
    In researching this issue, I disk repaired both the iPod (no errors), and the iMac (error found and repaired).  Still no joy in transferring files. 
    Another issue is that if I remove the 'corrupt' file it is necessary to start the file transfer process from scratch . . . until the next 'corrupt' file hits.  Any way to have the system not transfer the 'corrupt' files and have them listed in a transfer log so I can manually tinker with them since they do open and display properly on my iMac.
    Appreciate any help with this issue.
    ERROR MESSAGE:
    The finder cannot complete the operation because some data in "<file name> could not be read or written. (Error Code - 36).

    http://osxdaily.com/2015/02/21/fix-error-code-36-finder-mac-os-x/

  • File Transfer Error

    Whenever we try to use File Transfer, we get the following error message:
    1899. The connection with the Remote Management Agent is terminated.
    File Transfer used to work just fine. Any ideas on why it broke and how to
    fix it?
    Thanks!

    Blewis,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp
    - Check all of the other support tools and options available at
    http://support.novell.com.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://support.novell.com/forums)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://support.novell.com/forums/faq_general.html
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • File transfer errors between WP8.1 and W8.1

    This is probably in the wrong forum. But I cannot find anything which this falls under.
    Also please forgive my lack of competence in filing an issue like this.
    I own a Lumia 1020 and was trying to move photos off my phone to laptop. More specifically was trying to move the DNGs. I had already moved the jpegs. When it came to cutting or copying the DNGs I keep getting an unknown error saying that the operation would
    not work. (sorry I don't have a screenshot of the prompt)
    Now, I decided to restart my phone and lo and behold that batch of DNGs are now lost. Which I must say is quite a bad thing given that those photos were rather important.
    Since that cannot be undone, I decided to move the other DNGs which to my surprise actually did start the transfer process without any hiccup. But, when my phone went to sleep it seemed to sever the connection between my laptop and phone thus killing the
    file transfer process and generally 'unplugging' itself from my laptop until I unlocked it again.
    Again I'm not sure how to submit this or under what category it falls. But this is an issue which shouldn't be happening with the finalised version of WP8.1

    Hello,
    You could also ask in the
    Windows 8.1 forum on Microsoft Community.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Zen micro file transfer error and playing mista

    My Zen Micro 5GB had some problems wih the sound:sometimes, listening to a song, I heard (more orless) a second of another song but after that isreturned to the selected one. This is not the only problem: sometimes, whentransferring data between a PC and the player'sstorage dri've (2GB) it stops after a while.When transferring music from the player to the PCusing Music Organizer the PC receives some musicbut after a while it stops and displays amessage 'Cannot transfer file: file not found';after this, the player remains 'busy' also if youclose all the programs opened. I tried to fix this in many ways I installed the version 2.x firmware, so Icould re-install the latest .x version.2) I learned how to access the recovery functionsand I tried all of themBut after all this, it continues to display theerror message and I think sometimes it could stopplaying the song I'm listenig to and play asecond of another one.

    all the songs are mp3 format
    the transfer window pops up, the status will say writing for about 5sec. then the error comes up and says unable to create file - restart player and try again.
    but then the player has the acti've docked logo on, which you aren't supposed to unplug from the computer when that's on, but it will not go off. I've left it for hours and ended up unplugging it anyway. So I've restarted it, pulled the batter and retried that a few times too.
    Any ideas?
    thanks for your help

  • NB305-N440BL getting 0a-0224-0000 file transfer error message using USB Thumbdrive

    Doing total out of the box restore.
    First off, Toshiba, in their infinite wisdom sends a DVD Rom to you when you order a Recovery Media for a Netbook which has NO DVDROM.  I had to replace the HD after an accident and it is unreadable as a harddrive and had no backup.    As a result, the only thing I have left is to try and copy that to a Thumbdrive, because my backpack dvd writer is not recognized by the bios when booting.    I have a thumb drive big enough and have tried power iso with an extract to the thumbdrive, doing xcopy from the CD Rm as outlined here and other methods:
    http://www.wikihow.com/Install-Windows-from-a-USB-Flash-Drive
    I get the same error using the above two methods and could not get any further, I have tried to format the drive and delete the data, but I still get the message.....I am at my wits end.  Is there any software that will explode out the swm files on the DVD to what they are supposed to be so I can try to copy the raw files over and do a win to flash of version 7 with maybe some success????
    Any help would be appreciated. 

    I wouldn't try messing with transferring that data. You should call customer support and let them know about the mistake with the recovery media. It should have been sent on a USB stick.
    - Peter

  • File transfer problem during ISE 1.3 upgrade

    We have problem running the upgrade command:
    iseadm01/admin# application upgrade cleanup
    Application upgrade preparation directory cleanup successful
    iseadm01/admin# application upgrade prepare ise-upgradebundle-1.2.x-to-1.3.0.876.x86_64.tar.gz FTP
    Getting bundle to local machine...
    % File transfer error
    iseadm01/admin#
    The sniffertrace shows that the ISE 1.2 is sending TCP RST after about 30MB file transfer. If we run the command serveral times, it stops exactly after the same amount of transferred bytes.
    The disk utilazation looks OK:
    iseadm01/admin# dir
    Directory of disk:/
          16384 Sep 18 2014 15:55:48  lost+found/
               Usage for disk: filesystem
                      172761088 bytes total used
                    14275047424 bytes free
                    15234142208 bytes available
    iseadm01/admin#
    iseadm01/admin# dir
    Directory of disk:/
          16384 Sep 18 2014 15:55:48  lost+found/
               Usage for disk: filesystem
                      172761088 bytes total used
                    14275047424 bytes free
                    15234142208 bytes available
    iseadm01/admin#
    We have Another ISE (monitor node) and the problem is excact the same on that node.
    Thanks

    On FileZila click on the User Accounts Icon. The dialog box will show you  defined users. By default only anonymous is created.
    So you need to create a local ftp username and passowrd. Then assign it a home directory under shared folders. This will be the dfault location a remote clietn will look for files and where you would find the ISE upgrade package, for example.
    See following screenshot....

  • Display progress of file transfer

    I made a app that uses tcp sockets to transfer a file im using ObjectOutputStream/ObjectInputStream. The thread that downloads the file has:
    package chat;
    import javax.swing.*;
    import java.net.Socket;
    import java.net.URL;
    import java.io.*;
    public class DownloadSocket extends Thread{
        Socket peer;
        ObjectInputStream obin;
        FileOutputStream fout;
        String fileName;
        String filePath;
        Thread runner;
        JFrame parent;
        public DownloadSocket(Socket peer, JFrame parent){
    this.parent = parent;
         try{        obin=newObjectInputStreamnewBufferedInputStreampeer.getInputStream()));
                start();
            }catch(IOException ioe){}
        public void start(){
            runner = new Thread(this);
            runner.start();
        public void run(){
            try {
                fileName = (String)obin.readObject();
                byte[] b = (byte[])obin.readObject();
                fout = new FileOutputStream(fileName);
                fout.write(b);
                JOptionPane.showMessageDialog(parent,"Received File " + fileName,"Confirmation",JOptionPane.INFORMATION_MESSAGE);
            }catch(Exception e){ }
            finally{
                try{
                    runner = null;
                    fout.close();
                    obin.close();
                    peer.close();
                }catch(Exception e){}
        }How do I get the percentage of the transfer or how many bytes are sent at any given time so i can use it to update a JProgress bar at any given time. The max value for the progress bar ill be the number of byte to send and this class can send an update to it every second or so. This class send the whole file in one go so im not sure.
    I also saw another file transfer snippet that gets the byte count sent, but i'd like to do it this way if possible. The other way was:
    try{
                byte[] buf = new byte[1024];
                    OutputStream os = socket.getOutputStream();
                    BufferedOutputStream out = new BufferedOutputStream(os,1024);
                    String file = "test.exe"
                    FileInputStream in = new FileInputStream(file);
                    int i;
                    int bytecount=0;
                    while ((i = in.read(buf,0,1024)) != -1){
                    bytecount=bytecount+1024;
                    out.write(buf,0,i);
                    out.flush();
                in.close();
                    out.close();
                    System.out.println("Bytes Sent :"+bytecount);
            catch (IOException e){
                System.out.println(e);
            try {
                socket.close();
            catch (IOException e){
                System.out.println(e);

    Have you considered using a ProgressMonitorInputStream?

  • On Mac - Android File Transfer stopped working.   It says Unable to connect after installing the Verizon Software Update Utility from phone

    On Mac - Android File Transfer stopped working.   It says Unable to connect after installing the Verizon Software Update Utility from phone.

        Hi JoeC695,
    That's not good! We want your software to work properly. Have you tried uninstalling the Verizon Software Utility from your MAC? Do you receive a specific error message?
    Thanks,
    PamelaF_VZW
    Tweet us vzwsupport

  • "Windows - No Disk" error message on file transfer

    Hello!
    I updated our ZDM7 server from plain old ZDM7 with no updates to ZDM7 SP1
    IR1. Now, when initiating File Transfer operation with any workstation, up
    comes this error message:
    "Windows - No Disk"
    "Exception Processing Message c0000013 Parameters 75b6bf9c 4 75b6bf9c 75b6bf9c"
    [Cancel] [Try Again] [Continue]
    If I click "Continue" 4 times, file transfer starts up successfully.
    Any ideas about how to get rid of this annoying message?
    Toomas Aas

    Toomas,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://support.novell.com/forums)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://support.novell.com/forums/faq_general.html
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • NT 4.0, LabVIEW 6, Error 4 (END OF FILE) when trying to seek to byte offset 4096 (from start of file) when the file is larger than 2 Gig

    If I try to seek (or read) with the position mode wired and set for START, I get error 4 (END OF FILE) if the file is larger than 2 GB. I'm only trying to move the file pointer 4096 bytes, not trying to seek or read more than 2GB, but I get the error if the file is over 2Gig.
    Instead, I have to do reads, with the position mode unwired, until I get to the place in the file that I want to be.
    Is this expected behavior?

    Hello,
    LabVIEW File I/O functions use an I32 value to store the size of a file. This means that we are limited to ~2GB file sizes when using the File I/O functions in LabVIEW. This explains why you are seeing odd behavior when trying to read to the end of the file, since this is causing the byte count to exceed ~2GB.
    I hope this explanation sheds some light on the situation for you. Hopefully the workaround (repeated reads) is not too much of an inconvenience.
    Good luck with your application, and have a pleasant day.
    Sincerely,
    Darren Nattinger
    Applications Engineer
    National Instruments
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Error no. 4 in SAPGUI during graphic call or file transfer.

    Hi,
    In the landscape there are still 46b sap version, i have some functional queries that when i executes go to the sap graphic screen and it throws with no output. I understand that that it works in ECC version but not for 46b.
    This issue is related to SAPGUI, as i have the latest sapgui installed 710 that works well for ECC.
    But if i input the parameter in sap 46b system , and execute to get the graphic chart i get this:
    The Generation of Graphs for Stock Movements in the MC49 Transaction.
    When you call a hierarchy graphic, the following error messages are displayed
    1. 'Too much data in a table or too many tables defined
    2. E4: error writing to XC pipe: child #1 ( id: STAT ); reclen12
    3. Error no. 4 in SAPGUI during graphic call or file transfer.
    I have also look in to note 316232, 361222, 96885. for this but  this says to upgrade the sapgui,which is already in.
    What is the solution for this.
    Regards,
    Chetan.

    Take a look at this thread.  This may provide you some guidance as it appears that Error has been encountered before.
    [Link Here|Error no. 4 in SAPGUI with Graphics call or file  transfer;
    Regards,
    Zecher

Maybe you are looking for