easyui-filebox上传图片到阿里
应用场景:在fixbox图片上传时在预览图片img标签底下点击按钮触发一下函数
参考:https://www.cnblogs.com/awzf/p/9843814.html
js
//修改该时上传产品相关图片的方法 上传到阿里云
function uploadPic2(imgId,upimportFileForm,fixboxImg,fixboxImgHidden,linkbutton) {
var url = base+"/xxxx/xxxxx?statusType=xxxx&doType=xxxx";
var data = new FormData($(upimportFileForm)[0]);//相当将form表单中的所有文本name作为键形成n个键值对 可以用get("文本name")获取value值
// alert(data.get("upImg"))
if (data.get("upImg")== "" || data.get("upImg")== null || data.get("upImg")== undefined){
$.messager.alert('系统错误提示','获取文件错误','error');
return;
}
$(linkbutton).linkbutton('disable');
$.ajax({
url: url,
type: 'POST',
data: data,
dataType: 'JSON',
cache: false,
processData: false,
contentType: false,
beforeSend: function () {
$.messager.progress({
title: '提示',
msg: '文件上传中,请稍候……',
text: ''
});
},
complete: function () {
$.messager.progress('close');
},
success:function(data){
$(linkbutton).linkbutton('enable');
if (data.code =="500"){
$.messager.alert('系统错误提示',data.msg,'error');
return;
}
if (data.code =="200"){
$.messager.alert('成功提示',data.msg);
// alert(data.url);
$(fixboxImg).textbox('setText',data.url);
$(fixboxImgHidden).val(data.url);
$(imgId).attr("src",data.url);
return;
}
},
error: function(){
$(linkbutton).linkbutton('enable');
$.messager.alert('系统错误提示','请求服务器异常','error');
return;
}
})
}
后台:可百度上传图片到阿里 参考资料:https://blog.csdn.net/baidu_38990811/article/details/78413470
easyui-filebox上传图片到阿里的更多相关文章
- EasyUI filebox组件在IE下不兼容
EasyUI 1.4.1 jQuery v1.11.1 EasyUI1.4.1版本的filebox在IE9+环境下,提交表单上传文件时出错,不能使用.
- 上传图片到阿里云OSS和获取上传图片的外网url的步骤
啥都不说 直接上代码 1.html: <form action="/bcis/api/headImgUpload.json" method="post" ...
- 基于ASP.Net +easyUI框架上传图片,实现图片上传,提交表单
<body> <link href="../../Easyui/themes/easyui.css" rel="stylesheet" typ ...
- swift3.0 从相册选取或者拍照上传图片至阿里云OSS
导入相应的库 import Photos import AliyunOSSiOS 选取照片需要继承 UIImagePickerControllerDelegate,UINavigationContro ...
- multipartUpload上传图片到阿里云
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- vue 上传图片到阿里云(前端直传:不推荐)
为何要这样做:减轻后端数据库压力(个人觉得于前端没啥用,谁返回来都行) 代码部分: <template> <div class="upLoad"> < ...
- Java中使用RestFul接口上传图片到阿里云OSS服务器
1.接口方法 import java.io.IOException; import javax.servlet.http.HttpServletRequest; import org.springfr ...
- 压缩并上传图片到阿里云(jfinal)
/** * 获取上传文件 * * @param r * @Return: com.oreilly.servlet.multipart.FilePart */public static FilePart ...
- 基于ASP.Net +easyUI框架上传图片,判断格式+实现即时浏览
<div> 选择图片:<input id="idFile" style="width:224px" runat="server&qu ...
随机推荐
- js — 数组Array
目录 1. isArray 2. 转换方法 3. 分割字符串 join 4. 栈方法 5. 队列方法 6. 重排序方法 7. 操作方法 8. 位置方法 - 索引 9. 迭代方法 数组 array 解释 ...
- Flask 中command的使用
其实这个标题有点大了,只是记录以一下flask中command的一个使用方式,具体用法还需要看相关文档. 之前的项目中需要加一个定时任务所以在flask中写了个任务执行. 首先需要在manage.py ...
- 十三、GPIO子系统
由于之后的触摸屏驱动分析中使用到了GPIO子系统和i2c子系统,因此在分析触摸屏驱动之前我准备把这两个子系统进行简单分析. 之前我们使用GPIO引脚的方式并不是推荐的方式,当我们更改某一bit时,很有 ...
- spring cloud微服务实践一
最近在学习spring框架.其中spring cloud在微服务方面很火,所以在学习过程中,也做一些记录. 注:这一个系列的开发环境版本为 java1.8, spring boot2.x, sprin ...
- SAS学习笔记42 宏程序
Autocall Macro是由SAS提供的一些实现特定功能的Macro Program,可以在代码中直接使用 其中以Q开头的相比正常的多了隐藏特殊字符的功能(称之为Macro Quoting): K ...
- 怎样理解数组的空元素empty与undefined的区别
数组的空元素empty表示空位, 它不是一种数据类型, 而是由于人为修改arr.length 或者写入时多写了逗号造成的. var arr = [1,2,3,4,,,5]; arr.length; a ...
- WebSocket协议探究(三):MQTT子协议
一 复习和目标 1 复习 Nodejs实现WebSocket服务器 Netty实现WebSocket服务器(附带了源码分析) Js api实现WebSocket客户端 注:Nodejs使用的Socke ...
- 数据结构-平衡二叉树Java实现
1,Node.java package com.cnblogs.mufasa.BalanceBinaryTree; public class Node { Node parent; Node left ...
- XXX银行人事管理系统-数据库设计
1. 用户.权限.角色关系用户基本信息 userinfo [人员表]权限表actions[权限表]员工类型表usertype [管理组表]权限映射表actionmapping [权限映射表]权限分栏表 ...
- jQuery组件封装之return this.each(function () {});
记录一下自己的调试历程 组件封装经常看到这么一段代码 $.fn.plugin = function (options) { return this.each(function (i,t) { new ...