In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Cloud Computing Learning Route course outline Courseware: about HTTP Server:
=
Static element: .html .img js css swf mp4
Dynamic element: .php .jsp .cgi .asp php SQL
Web Server:
Nginx (Tengine), Apache, IIS
Web middleware:
Php: PHP-fpm 、 HHVM
Jsp: Tomcat 、 JBOSS 、 Resin 、 IBM WebSphere
Common combinations:
LNMP (Linux + Nginx + MySQL + PHP) / / php-fpm process
LAMP (Linux + Apache + MySQL + PHP) / / php as the module of Apache
Nginx + Tomcat / / replace Apache and combine with Tomcat
=
Server:
# coding=utf-8
From BaseHTTPServer import BaseHTTPRequestHandler
Import cgi
Class PostHandler (BaseHTTPRequestHandler):
Def do_POST (self):
Form = cgi.FieldStorage (
Fp=self.rfile
Headers=self.headers
Environ= {'REQUEST_METHOD':'POST'
'CONTENT_TYPE':self.headers ['Content-Type']
}
Self.send_response (200)
Self.end_headers ()
Self.wfile.write ('Client:% sn'% str (self.client_address))
Self.wfile.write ('User-agent:% sn'% str (self.headers [' user-agent']))
Self.wfile.write ('Path:% sn'%self.path)
Self.wfile.write ('Form data:n')
For field in form.keys ():
Field_item = form [field]
Filename = field_item.filename
Filevalue = field_item.value
Filesize = len (filevalue) # File size (in bytes)
# print len (filevalue)
# print (filename)
With open (filename.decode ('utf-8'),' wb') as f:
F.write (filevalue)
Return
Def StartServer ():
From BaseHTTPServer import HTTPServer
Sever = HTTPServer ((", 8080), PostHandler)
Sever.serve_forever ()
If name=='main':
StartServer ()
Client:
# coding=utf-8
Import requests
Url = "http://172.16.1.101:8080"
Path = "/ home/ly/ly.exe"
Print path
Files = {'file': open (path,' rb')}
R = requests.post (url, files=files)
Print (r.url)
Print (r.text)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.