Socket programming download file




















Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 7 years, 6 months ago. Active 2 months ago. Viewed 19k times. Your help will be appreciated. Improve this question. Pawan Chaurasiya Pawan Chaurasiya 2 2 gold badges 15 15 silver badges 29 29 bronze badges. Add a comment. Active Oldest Votes. Create a socket using socket Call connect on it. Receive the response using either recv or read properly. Parse the response to find out if the request succeeded and what format the file data is being sent as.

Open both programs and start compiling server. Then, compile client. Input the IP address of a server in dotted decimal notation format, and port number. Then repeat step 3. Then repeat step 4. Step 4 will be repeated until step 5 is completed.

Then, uploads the file line by line until last line is reached. Error reached when file given does not exist. Then, store the file line by line until last line is reached. Server Code : This code is now for one file The required help is how to download and save that file which is found at server. Note: server code is not robust and will crash when file doesn't exists. You should modify above example according to your needs. How are we doing? Please help us improve Stack Overflow.

Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to download file from local server in Python Ask Question. Asked 6 years, 10 months ago. Active 6 years, 10 months ago. Viewed 13k times. Scenario is: Client will Enter a file name e. Client will select 1 or 2 or 3 if there. My code so far is for searching the file.



0コメント

  • 1000 / 1000