473,508 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File transfer

Hi all,
I have created a chat application, and one of it's functionality to
send files to the connected user.
I read the contents of the files into a Byte array and send that
through sockets.
Now when i send a file of 150 kb size the file seems to be corrupted at
the receivers end.
some part of the file is not received.
Is there any restriction of size for sending files across internet
using sockets?

I am able to send small files without any problem.
When i run the same application locally, i am able to send huge files
of 3-4 MB easily.

Can anyone point out why this is happening?

Sep 8 '06 #1
2 2474
You might have a problem with not all the data being sent. Are you flushing
the socket after writing everything. I have implemented a system similar
before but I had a control channel setup which enabled me to inform the
reciever first of the total number of bytes in the file. I was then able to
wait till they all arrived but they didn't until the sender flushed.

HTH

Ciaran O'Donnell

"Pramod" wrote:
Hi all,
I have created a chat application, and one of it's functionality to
send files to the connected user.
I read the contents of the files into a Byte array and send that
through sockets.
Now when i send a file of 150 kb size the file seems to be corrupted at
the receivers end.
some part of the file is not received.
Is there any restriction of size for sending files across internet
using sockets?

I am able to send small files without any problem.
When i run the same application locally, i am able to send huge files
of 3-4 MB easily.

Can anyone point out why this is happening?

Sep 8 '06 #2
Thanks for the reply,
I have done the same thing, i send the size first and initialize the
byte array of that size,
but still it doesn't works.
I am having the chat server application on a server that is situated in
US and i am
running the client app from here in India.
Does the Internet connection creates any problem?

Ciaran O''Donnell wrote:
You might have a problem with not all the data being sent. Are you flushing
the socket after writing everything. I have implemented a system similar
before but I had a control channel setup which enabled me to inform the
reciever first of the total number of bytes in the file. I was then able to
wait till they all arrived but they didn't until the sender flushed.

HTH

Ciaran O'Donnell

"Pramod" wrote:
Hi all,
I have created a chat application, and one of it's functionality to
send files to the connected user.
I read the contents of the files into a Byte array and send that
through sockets.
Now when i send a file of 150 kb size the file seems to be corrupted at
the receivers end.
some part of the file is not received.
Is there any restriction of size for sending files across internet
using sockets?

I am able to send small files without any problem.
When i run the same application locally, i am able to send huge files
of 3-4 MB easily.

Can anyone point out why this is happening?
Sep 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
8636
by: Lingyun Yang | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** Dear all, I have a file it's binary data viewed in UltraEdit is EF BB BF 0D 0A 3C ....... I want to read them into a int or long...
11
6593
by: Abhishek | last post by:
I have a problem transfering files using sockets from pocket pc(.net compact c#) to desktop(not using .net just mfc and sockets 2 API). The socket communication is not a issue and I am able to...
11
32553
by: Stephan Steiner | last post by:
Hi Generally, FileInfo fi = new FileInfo(path); long size = fi.Length; gets you the length of a file in bytes. However, when copying files, even while the copy operation is still in...
8
7563
by: Xarky | last post by:
Hi, I am downloading a GIF file(as a mail attachement) with this file format, Content-Transfer-Encoding: base64; Now I am writing the downloaded data to a file with this technique: ...
15
4713
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
1
8065
by: Alex | last post by:
Hello, I'm trying to write a little php script to transfert some files from a server to clients (web/http). It's working fin with small files. But transfering big files (try on 1Gb) failed!...
10
10582
by: David | last post by:
I have googled to no avail on getting specifically what I'm looking for. I have found plenty of full blown apps that implement some type of file transfer but what I'm specifcally looking for is an...
2
3861
by: tedpottel | last post by:
Hi, My program has the following code to transfer a binary file f = open(pathanme+filename,'rb') print "start transfer" self.fthHandle.storbinary('STOR '+filename, f) How can I do an ASCII...
0
2058
by: fiona | last post by:
Yucca Valley, CA, - October 2007: Catalyst Development Corporation, publisher of SocketTools, SocketWrench and LogicGem, today announced the release of Catalyst File Transfer .NET V5.0. For...
6
2769
by: Thom Little | last post by:
I need to transfer an XML file between an application on the client and the server. This would in fact be a copy of the application's .config file. HTML <input form=...would transfer the file...
0
7124
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7385
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3195
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1558
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.