Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8700489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:10:47+00:00 2026-06-13T02:10:47+00:00

I want to send files over the network, however all the tools and commands

  • 0

I want to send files over the network, however all the tools and commands that was proposed to me wont allow me to automate the process.

Now I remember there’s a function in java which allows you to convert the file into json base64 string, then this string will be sent over the network, then the machine that will receive this will rebuild this into file.

I wonder if I could do that kind of stuff in python?

Any ideas? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:10:48+00:00Added an answer on June 13, 2026 at 2:10 am

    well, reading a file and writing a file are easy:

    #read from a file
    with open("path/to/file", "rb") as read_file:
        contents = read_file.read()
    #write to a file
    with open("path/to/file", "wb") as write_file:
        write_file.write(contents)
    

    and for base64 encoding, look at the python docs

    sending data over a connection is simple enough, and you can do it in many methods – i am not going to solve it here, but i will give you a list of methods you can use:

    • the python socket module, doc
    • another post about data: (Python) Send structured packet over network

    here is an example using socket from http://wiki.python.org/moin/TcpCommunication

    import socket
    
    TCP_IP = '127.0.0.1'
    TCP_PORT = 5005
    BUFFER_SIZE = 1024
    MESSAGE = "Hello, World!"
    
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((TCP_IP, TCP_PORT))
    s.send(MESSAGE)
    data = s.recv(BUFFER_SIZE)
    s.close()
    
    print "received data:", data
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text file that I want to send over the network, this
I want to send large files over Bonjure network. When I send a file
In my program, I stat the files they want and send the data over.
I want to send files through php using readfile() What i've noticed is that
I want to send .patch files that were generated by the git format-patch command
I want to send a file in C++ over network (for a chat program)
how can i send multiple files over TCP with C#, all the samples on
I want to use the TcpClient and TcpListener to send an mp3 file over
I want to be able to send files from an iPhone app to a
I want to lock files that is on the sdcard of android. I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.