资源简介
angularjs+html5+源码,页面30几个,全英文angularjs+html5+源码,页面30几个,全英文angularjs+html5+源码,页面30几个,全英文
代码片段和文件信息
# -*- coding: utf-8 -*-
#
# jQuery File Upload Plugin GAE Python Example 2.2.0
# https://github.com/blueimp/jQuery-File-Upload
#
# Copyright 2011 Sebastian Tschan
# https://blueimp.net
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT
#
from __future__ import with_statement
from google.appengine.api import files images
from google.appengine.ext import blobstore deferred
from google.appengine.ext.webapp import blobstore_handlers
import json
import re
import urllib
import webapp2
WEBSITE = ‘https://blueimp.github.io/jQuery-File-Upload/‘
MIN_FILE_SIZE = 1 # bytes
MAX_FILE_SIZE = 5000000 # bytes
IMAGE_TYPES = re.compile(‘image/(gif|p?jpeg|(x-)?png)‘)
ACCEPT_FILE_TYPES = IMAGE_TYPES
THUMBNAIL_MODIFICATOR = ‘=s80‘ # max width / height
EXPIRATION_TIME = 300 # seconds
def cleanup(blob_keys):
blobstore.delete(blob_keys)
class UploadHandler(webapp2.RequestHandler):
def initialize(self request response):
super(UploadHandler self).initialize(request response)
self.response.headers[‘Access-Control-Allow-Origin‘] = ‘*‘
self.response.headers[
‘Access-Control-Allow-Methods‘
] = ‘OPTIONS HEAD GET POST PUT DELETE‘
self.response.headers[
‘Access-Control-Allow-Headers‘
] = ‘Content-Type Content-Range Content-Disposition‘
def validate(self file):
if file[‘size‘] < MIN_FILE_SIZE:
file[‘error‘] = ‘File is too small‘
elif file[‘size‘] > MAX_FILE_SIZE:
file[‘error‘] = ‘File is too big‘
elif not ACCEPT_FILE_TYPES.match(file[‘type‘]):
file[‘error‘] = ‘Filetype not allowed‘
else:
return True
return False
def get_file_size(self file):
file.seek(0 2) # Seek to the end of the file
size = file.tell() # Get the position of EOF
file.seek(0) # Reset the file position to the beginning
return size
def write_blob(self data info):
blob = files.blobstore.create(
mime_type=info[‘type‘]
_blobinfo_uploaded_filename=info[‘name‘]
)
with files.open(blob ‘a‘) as f:
f.write(data)
files.finalize(blob)
return files.blobstore.get_blob_key(blob)
def handle_upload(self):
results = []
blob_keys = []
for name fieldStorage in self.request.POST.items():
if type(fieldStorage) is unicode:
continue
result = {}
result[‘name‘] = re.sub(
r‘^.*\\‘
‘‘
fieldStorage.filename
)
result[‘type‘] = fieldStorage.type
result[‘size‘] = self.get_file_size(fieldStorage.file)
if self.validate(result):
blob_key = str(
self.write_blob(fieldStorage.value result)
)
blob_keys.append(blob_key)
result[‘deleteType‘] = ‘DELET
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-03-14 00:25 clip-two_v1.2.1\
目录 0 2015-03-14 00:25 clip-two_v1.2.1\AngularJs-Admin\
目录 0 2015-03-14 00:25 clip-two_v1.2.1\AngularJs-Admin\Documentation\
目录 0 2015-03-14 00:25 clip-two_v1.2.1\AngularJs-Admin\Documentation\assets\
目录 0 2015-03-14 00:25 clip-two_v1.2.1\AngularJs-Admin\Documentation\assets\css\
文件 113498 2015-02-26 00:08 clip-two_v1.2.1\AngularJs-Admin\Documentation\assets\css\bootstrap.min.css
文件 604 2015-02-26 00:08 clip-two_v1.2.1\AngularJs-Admin\Documentation\assets\css\doc.css
文件 291444 2015-02-26 00:08 clip-two_v1.2.1\AngularJs-Admin\Documentation\assets\css\st
目录 0 2015-03-14 00:25 clip-two_v1.2.1\AngularJs-Admin\Documentation\assets\js\
文件 325 2015-02-26 00:08 clip-two_v1.2.1\AngularJs-Admin\Documentation\assets\js\custom.js
文件 96383 2015-02-26 00:08 clip-two_v1.2.1\AngularJs-Admin\Documentation\assets\js\jquery.js
文件 2681 2015-02-26 00:08 clip-two_v1.2.1\AngularJs-Admin\Documentation\assets\js\jquery.scrollTo.min.js
文件 73004 2015-03-14 00:24 clip-two_v1.2.1\AngularJs-Admin\Documentation\documentation.html
目录 0 2015-03-14 00:25 clip-two_v1.2.1\AngularJs-Admin\RTL\
目录 0 2015-03-14 00:25 clip-two_v1.2.1\AngularJs-Admin\RTL\assets\
目录 0 2015-03-14 00:25 clip-two_v1.2.1\AngularJs-Admin\RTL\assets\api\
文件 207 2015-03-13 19:56 clip-two_v1.2.1\AngularJs-Admin\RTL\assets\api\groups.js
目录 0 2015-03-14 00:25 clip-two_v1.2.1\AngularJs-Admin\RTL\assets\css\
文件 17968 2015-03-13 19:56 clip-two_v1.2.1\AngularJs-Admin\RTL\assets\css\animate.css
文件 12085 2015-03-13 20:01 clip-two_v1.2.1\AngularJs-Admin\RTL\assets\css\plugins.css
文件 391842 2015-03-13 20:01 clip-two_v1.2.1\AngularJs-Admin\RTL\assets\css\rtl.css
文件 291624 2015-03-13 20:01 clip-two_v1.2.1\AngularJs-Admin\RTL\assets\css\st
目录 0 2015-03-14 00:25 clip-two_v1.2.1\AngularJs-Admin\RTL\assets\css\themes\
文件 11329 2015-03-13 20:01 clip-two_v1.2.1\AngularJs-Admin\RTL\assets\css\themes\theme-1.css
文件 11308 2015-03-13 20:01 clip-two_v1.2.1\AngularJs-Admin\RTL\assets\css\themes\theme-2.css
文件 11457 2015-03-13 20:01 clip-two_v1.2.1\AngularJs-Admin\RTL\assets\css\themes\theme-3.css
文件 11380 2015-03-13 20:01 clip-two_v1.2.1\AngularJs-Admin\RTL\assets\css\themes\theme-4.css
文件 11687 2015-03-13 20:01 clip-two_v1.2.1\AngularJs-Admin\RTL\assets\css\themes\theme-5.css
文件 11304 2015-03-13 20:01 clip-two_v1.2.1\AngularJs-Admin\RTL\assets\css\themes\theme-6.css
目录 0 2015-03-14 00:25 clip-two_v1.2.1\AngularJs-Admin\RTL\assets\fonts\
文件 15736 2015-03-13 19:56 clip-two_v1.2.1\AngularJs-Admin\RTL\assets\fonts\clip-two.eot
............此处省略5659个文件信息
相关资源
- HTML5视频播放器159430
- 仿小米官网(html+js+css),html5+jq+cs
-
疯狂HTML5+CSS3+ja
vasc ript讲义 - HTML5与CSS3权威指南第3版下-陆凌牛
- HTML5与CSS3基础教程第8版高清pdf
- HTML5旅游景区景点响应式网站模板
- 完整的一套html5页面
- [FastVideo]Web Html5 无插件方式连接海康
- H5 html5 wap bootstrap 10个网站模板,从几
- MGP游戏平台.rar
- html5跑酷游戏《迷失之岛》源码
- HTML5游戏《被淹没的王国》源码
- html5寻宝类《泰坦之国》游戏源码
- html5卡通动物足球赛游戏源码
- HTML5 Canvas : Native Interactivity and Animat
- html5大作业.zip
- 北大青鸟一HTML5+CSS3所有课程所有作业
- HTML5权威指南 源码
- 60多套html5移动端模板
- 基于html5的电商网页设计.rar
- oracle11g最新最全的官方帮助文档-par
- 15个手机页面模板源码,html5
- HTML5+CSS3网站设计基础教程_动手实践源
-
HTML5CSS3ja
vasc ript网页设计案例课堂 - HTMl5结婚微信电子请柬模板源码
- 基于HTML5的电商网站的设计与开发
-
HTML5 CSS3 ja
vasc ript从入门到精通高 - HTML5与CSS3权威指南 第3版(上下册合集
- [FastVideo]Web Html5 无插件方式连接海康
- 网页音乐播放器 html5 实验报告
评论
共有 条评论