Mac os virtualbox 共享文件夹1/2/2023 # transmitted *less* than the content-length! # newline translations, making the actual size of the content # redirect browser - doing basically what apache does None, in which case the caller has nothing further to do. To the outputfile by the caller unless the command was HEAD,Īnd must be closed by the caller under all circumstances), or Return value is either a file object (which has to be copied This sends the response code and MIME headers. """Common code for GET and HEAD commands. Return (True, "File '%s' upload success!" % fn) Return (False, "Can't create file to write, do you have permission to write?") Return (False, "Can't find out file name.") Return (False, "Content NOT begin with boundary")įn = re.findall(r'Content-Disposition.*name="file" filename="(.*)"', line) nd_header("Content-Length", str(length))īoundary = ("=") Print r, info, "by: ", self.client_addressį.write("back" % self.headers)į.write("Powered By: bones7456, check new version at ") Server_version = "SimpleHTTPWithUpload/" + _version_ Request omits the actual contents of the file. The GET/HEAD/POST requests are identical except that the HEAD The MIME type for files is determined byĬalling the. This serves files from the current directory and any of its """Simple HTTP request handler with GET/HEAD/POST commands. This module builds on BaseHTTPServer by implementing the standard GETĪnd HEAD requests in a fairly straightforward manner.Ĭlass SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |