uploader

How to upload a file using javascript?

亡梦爱人 提交于 2019-12-09 23:00:18
问题 I want to create a uploader with js. Can anyone help me how to upload a file using javascript? 回答1: You can use html5 file type like this: <input type="file" id="myFile"> You file will be in value: var myUploadedFile = document.getElementById("myFile").files[0]; For more information see https://www.w3schools.com/jsref/dom_obj_fileupload.asp and see example here: https://www.script-tutorials.com/pure-html5-file-upload/ 回答2: You can upload files with XMLHttpRequest and FormData . The example

Display Media Uploader in Own Plugin on Wordpress 3.5

落花浮王杯 提交于 2019-12-08 06:37:47
问题 I have little problem with Media Uploader in new WordPress 3.5. I created own plugin which is upload the picture. I'm using this code JS: <script type="text/javascript"> var file_frame; jQuery('.button-secondary').live('click', function( event ){ event.preventDefault(); if ( file_frame ) { file_frame.open(); return; } file_frame = wp.media.frames.file_frame = wp.media( { title: 'Select File', button: { text: jQuery( this ).data( 'uploader_button_text' ) }, multiple: false } ); file_frame.on(

Can I read Exif data of a picture in the client-side with js?

江枫思渺然 提交于 2019-12-08 04:32:37
问题 I have a little "big" problem. I use agile-uploader to upload multiple image, this component resize all the picture (it works very well) but by doing this I lose exif data. Can I read exif data in the client-side using JS ? given that isn't the same name domain. 回答1: Yes. There's a new library exifr with which you can do exactly that. It's maintained, actively developed library with focus on performance and works in both nodejs and browser. Simple example of extracting exif from one file:

vue 中使用vant-ui van-uploader插件上传多张图片

自作多情 提交于 2019-12-06 11:46:01
html <!--TODO 这是上传多张图--> <div class="ver-code-bottom-one-right-code"> <div class="posting-uploader-item" v-for="(item,index) in postData" :key="index"> <img :src="item" alt="图片" class="imgPreview"> <van-icon name="close" @click="delImg(index)" class="delte"/> </div> <van-uploader :after-read="afterZRead" :accept="'image/*'" v-show="postData.length<=1" /> </div> script export default { name: "banner", data(){ return{ realName:'', phone:'', imgHeader:'', fileList: [], mod_pic_one:'', mod_pic_two:'', mod_ping_img:'', postData:[], mod_pic_list:[], mod_banner_name:'' } }, props: ['refundImages'],

vue 中使用vant-ui van-uploader插件上传多张图片

﹥>﹥吖頭↗ 提交于 2019-12-05 09:56:54
html <!--TODO 这是上传多张图--> <div class="ver-code-bottom-one-right-code"> <div class="posting-uploader-item" v-for="(item,index) in postData" :key="index"> <img :src="item" alt="图片" class="imgPreview"> <van-icon name="close" @click="delImg(index)" class="delte"/> </div> <van-uploader :after-read="afterZRead" :accept="'image/*'" v-show="postData.length<=1" /> </div> script export default { name: "banner", data(){ return{ realName:'', phone:'', imgHeader:'', fileList: [], mod_pic_one:'', mod_pic_two:'', mod_ping_img:'', postData:[], mod_pic_list:[], mod_banner_name:'' } }, props: ['refundImages'],

A Simple Uploader using AngularJs (with CORS Implementation)

馋奶兔 提交于 2019-12-02 17:44:00
问题 Recently, I had to write a simple uploader (reusable) using AngularJs, while, keeping my API in separate place and finally wrote one using blueimp jQuery File Uploader and made lil customizing it. I Thought it might be great to share this and hopefully improve myself in learning in AngularJs. (I've added the answer) 回答1: http://codelikeapoem.com/2013/05/angularjs-tutorial-4-file-upload-using.html (You can download the entire code their) App.Coffee @angTut = angular.module("angTut", [

A Simple Uploader using AngularJs (with CORS Implementation)

不羁的心 提交于 2019-12-02 09:29:10
Recently, I had to write a simple uploader (reusable) using AngularJs, while, keeping my API in separate place and finally wrote one using blueimp jQuery File Uploader and made lil customizing it. I Thought it might be great to share this and hopefully improve myself in learning in AngularJs. (I've added the answer) http://codelikeapoem.com/2013/05/angularjs-tutorial-4-file-upload-using.html (You can download the entire code their) App.Coffee @angTut = angular.module("angTut", ['LocalStorageModule', 'ngResource', 'uploaderComponent']); @angTut.constant('uploadServiceUrl', 'http://192.168.0.2

vux-uploader改造,用于oss直传

﹥>﹥吖頭↗ 提交于 2019-11-30 18:00:33
vux-uploader这个图片上传插件,在一些项目中已经采用了。因为之前的前端ui都是用vux这套,所以理所当然也选择这个图片上传插件了。而且还提供一些可以进行定制化hook。 greedying/vux-uploader 其中最重要的代码 uploader.vue get_signature(body){ // 可以判断当前expire是否超过了当前时间, 如果超过了当前时间, 就重新取一下,3s 作为缓冲。 let timestamp = Date.parse(new Date()) / 1000; let now = timestamp; let expire = 0 if (expire < now + 3) { // let body = this.send_request() console.log(body) // let obj = eval ("(" + body + ")"); let obj = body // console.log(obj); this.uploadUrl = obj['host']; this.oss.host = obj['host'] this.oss.policyBase64 = obj['policy'] this.oss.accessid = obj['accessid'] this.oss.signature = obj[

Uploading multiple files simultaneously with Flex

你说的曾经没有我的故事 提交于 2019-11-30 07:50:32
I have been working on a flex uploader, where the user can select multiple files. It works fine when the files are uploaded in a queue (one at a time), however as soon as I try to have it upload 2 files at once I run into issues. It seems that files will often lock up, and either stay at 1% until every other file is uploaded, or just not complete at all. There is never more than one file uploading at a time. Is there some issue with calling .upload on multiple files at once in Flex? Unfortunately it's a browser limitation of 2 (depending on browser) active connections per host. Meaning only 2

Uploading multiple files simultaneously with Flex

大兔子大兔子 提交于 2019-11-29 09:54:27
问题 I have been working on a flex uploader, where the user can select multiple files. It works fine when the files are uploaded in a queue (one at a time), however as soon as I try to have it upload 2 files at once I run into issues. It seems that files will often lock up, and either stay at 1% until every other file is uploaded, or just not complete at all. There is never more than one file uploading at a time. Is there some issue with calling .upload on multiple files at once in Flex? 回答1: