0

client side code

import socket
import sys

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("localhost",9999))
path=raw_input("Please enter the complete PATH of your file :  ")
f=open (path, "rb") 
l = f.read(2048)
while (l):
    s.sendall(l)
    l = f.read(2048)
s.close()

server side code

import socket
import sys

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(("localhost",9999))
s.listen(10) 

while True: 
    s, address = s.accept()

    print address
    i=1
    f = open( str(i),'wb') #open in binary
    i=i+1
    while (True):       

        l = s.recv(2048)

        f.write(l)
        l = s.recv(2048)
        print 'File recieve succesfully'
f.close()

s.close()
1
Contributor
1
Reply
13
Views
3 Years
Discussion Span
Last Post by Rohit_14
0

in above code file transfering is happening only upto 500kb and i have to transfer till 500mb after sending the file to the server the file not taking the exact filename sending from the client these are the main issuse please if any one can help me

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.