settings =
(r"/", mainhandler),
(r"/login", loginhandler),
], **settings)
ajax發跨域請求 本質上就是去獲取本地的cookie,攜帶cookie再來傳送請求
function getcookie(name)
jquery.postjson = function(url, args, callback) });
};
注意檔案檔案上傳不太一樣import tornado.ioloop
import tornado.web
class mainhandler(tornado.web.requesthandler):
def get(self):
self.render('index.html')
def post(self, *args, **kwargs):
file_metas = self.request.files["fff"]
# print(file_metas)
for meta in file_metas:
file_name = meta['filename']
with open(file_name,'wb') as up:
up.write(meta['body'])
settings =
(r"/index", mainhandler),
], **settings)
if __name__ == "__main__":
tornado.ioloop.ioloop.instance().start()
js上傳
jq上傳
html - xmlhttprequest
3 iframe 一直沒用過
4 後端**都一樣
參考
git在分支上建立目錄和檔案
建立乙個空目錄,在其中初始化git git init 建立乙個新檔案,此時預設在master分支上 touch file1.txt add到staging area git add file1.txt 提交變化 git commit m the first commit 建立乙個新的分支 git b...
git在分支上建立目錄和檔案
建立乙個空目錄,在其中初始化git git init 建立乙個新檔案,此時預設在master分支上 touch file1.txt add到staging area git add file1.txt 提交變化 git commit m the first commit 建立乙個新的分支 git b...
linux上查詢檔案存放地點和檔案中查詢字串方法
1 locate 語法 locate locate命令實際是 find name 的另一種寫法,但是查詢方式跟find不同,它比find快得多。因為它不搜尋具體目錄,而是在乙個資料庫 var lib locatedb 中搜尋指定的檔案。次資料庫含有本地檔案的所有資訊,此資料庫是linux系統自動建立...