qiniu / form-upload Goto Github PK
View Code? Open in Web Editor NEWForm upload demo for Qiniu Cloud Storage
Form upload demo for Qiniu Cloud Storage
之前看到有朋友讨论说可能会加这样的魔法变量,请问现在有了吗,看文档里还没有呢
因为文件上传后,文件名肯定是唯一的,我这不前端不希望再去弄套规则生成唯一文件名了,如果能直接传一个文件后缀就好了,或者说不传key
默认就是上传文件的后缀名就好了 : )
<iframe id='callback-iframe' src='/callback.html' frameborder='0' width='0' height='0'></iframe>
<form method="post" action="http://up.qiniu.com/" enctype="multipart/form-data" target='callback-iframe'>
<input name="key" type="hidden" value="<Your file name in qiniu>">
<input name="x:<custom_field_name>" type="hidden" value="<Value of your custom param>">
<input name="token" type="hidden" value="<Your uptoken from server>">
<input name="file" type="file"/>
<input name="jsonp" type="hidden" value="<custom javascript function name>">
</form>
低级浏览器不支持ajax上传文件时,要用iframe来做无刷新处理,此时如果七牛api支持JSONP格式应答,可以把key和hash及其他应答传递给用户自定义的jsonp callback函数。
预期应答如下:
Content-Type : application/javascript
body:
xyzJavascriptCallbackFunction({ /*xyzJavascriptCallbackFunction is the jsonp parameter's value*/
'key' : 'adhsaljfhdlskf',
'hash' : 'shflsdfhldshflsd'
//,.....
});
如题,很需要啊,在网上找到的例子都是老的,都失效了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.