跨域

vm.uploadFiles = function (file, errFiles) {
if (file) {
file.upload = Upload.upload({
url: vm.uploadurl + "upadloadimgs?imgtype=upload",
data: {
files: file
}
});
abp.ui.setBusy();

file.upload.then(function (response) {
abp.ui.clearBusy();
if (response.status == "200") {
abp.notify.info("上传成功!");
vm.adimagefile = vm.uploadurl + response.data.Data.substring(1);
vm.adimage.adImageUrl = response.data.Data;
}
else {
abp.message.error(response.status + ': ' + response.data);
}
//alert("成功?");
}, function (response) {
abp.ui.clearBusy();
if (response.status > 0) {
abp.message.error(response.status + ': ' + response.data);

}
//$scope.errorMsg = response.status + ': ' +response.data;
}, function (evt) {
file.progress = Math.min(100, parseInt(100.0 *
evt.loaded / evt.total));
});
}
}

同域

vm.uploadFiles = function (file, errFiles, item) {
//alert(item);
if (file) {
file.upload = Upload.upload({
url: abp.appPath + "FileUpload/Upload?uptype=cmsimage",
data: {
files: file
}
});
abp.ui.setBusy();

file.upload.then(function (response) {
abp.ui.clearBusy();
if (response.status == "200") {
abp.notify.info("上传成功!");
item.adimagefile = abp.appPath + response.data[0].substring(1);
item.settingValue = response.data[0];
}
else {
abp.message.error(response.status + ': ' + response.data);
}
//alert("成功?");
}, function (response) {
abp.ui.clearBusy();
if (response.status > 0) {
abp.message.error(response.status + ': ' + response.data);

}
//$scope.errorMsg = response.status + ': ' +response.data;
}, function (evt) {
file.progress = Math.min(100, parseInt(100.0 *
evt.loaded / evt.total));
});
}
}

ng file上传同域非同域的更多相关文章

  1. input type=file 上传文件样式美化(转载)

    input type=file 上传文件样式美化 来源:https://www.jianshu.com/p/6390595e5a36 在做input文本上传时,由于html原生的上传按钮比较丑,需要对 ...

  2. python 之 前端开发(form标签、单选框、多选框、file上传文件、按钮、label标签、下拉列表、textarea标签、fieldset标签、table标签)

    11.25 form标签 <!DOCTYPE html> <html lang="en"> <head> <meta charset=&q ...

  3. ajax+ashx 完美实现input file上传文件

    1.input file 样式不能满足需求 <input type="file" value="浏览" /> IE8效果图:    Firefox效 ...

  4. 如何用一张图片代替 'input:file' 上传本地文件??

    今天去面试,碰到了一道题,也许是因为紧张或者喝水喝多了,一时竟然没有转过弯来,回来之后一细想原来这么简单,哭笑不得,特此记录一下! 原题是这样的:  如何用一张图片代替 'input:file' 上传 ...

  5. HTML5: input:file上传类型控制

    ylbtech-HTML5: input:file上传类型控制   1. 一.input:file 属性返回顶部 一.input:file属性 属性值有以下几个比较常用: accept:表示可以选择的 ...

  6. HTML5的 input:file上传类型控制(转载)

    http://www.haorooms.com/post/input_file_leixing HTML5的 input:file上传类型控制 2014年8月29日 66352次浏览 一.input: ...

  7. Js获取file上传控件的文件路径总结

    总结一个获取file上传控件文件路径的方法 firefox由于保护机制只有文件名,不能获取完整路径. document.getElementById('file').onchange = functi ...

  8. spring mvc 图片上传,图片压缩、跨域解决、 按天生成文件夹 ,删除,限制为图片代码等相关配置

    spring mvc 图片上传,跨域解决 按天生成文件夹 ,删除,限制为图片代码,等相关配置 fs.root=data/ #fs.root=/home/dev/fs/ #fs.root=D:/fs/ ...

  9. SWFUpload多图上传、C#后端跨域传文件带参数

    前几天工作中用到了SWFUpload上传图片,涉及到跨域,因为前端无法实现跨域,所以只能把文件传到后端进行跨域请求,整理分享下. 效果图 前端 html部分 <!DOCTYPE html> ...

随机推荐

  1. HttpClient 处理中文乱码

    HttpClient 请求的中文乱码问题 相关类库: commons-codec-1.3.jar,commons-httpclient-3.1.jar,commons-logging-1.1.1.ja ...

  2. 使用.Net中的WeakDictionary — ConditionalWeakTable

    有的时候,我们需要给某些数据添加一些附加信息,一种常用的做法是使用一个Dictionary在填充这些附加信息如: var data = new Data();    var tag = new Tag ...

  3. Inno Setup入门(十三)——Pascal脚本(2)

    事件函数(2) function CheckPassword(Password: String): Boolean; 如果安装程序在Pascal 脚本中发现该函数,它自动显示密码页并调用CheckPa ...

  4. 引用日志log4net.dll的web.config配置

    <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigu ...

  5. 关于shape和selector和layer-list的drawable详细说明

    在Android开发中,但凡涉及控件的的特效问题,<shape>,<selector>以及<layer-list>都是不可或缺的drawable.但是发现有同事并不 ...

  6. oracle 10g函数大全--聚合函数

    AVG([distinct|all]x) [功能]统计数据表选中行x列的平均值. [参数]all表示对所有的值求平均值,distinct只对不同的值求平均值,默认为all 如果有参数distinct或 ...

  7. D3.js系列——元素操作和简单画布操作

    一.元素操作: 1.选择元素 select 和 selectAll,以及选择集的概念 var p = d3.select("body").select("p") ...

  8. http://blog.sina.com.cn/s/blog_62e1faba010147k4.html

    http://blog.sina.com.cn/s/blog_62e1faba010147k4.html

  9. 算法导论-散列表(Hash Table)-大量数据快速查找算法

    目录 引言 直接寻址 散列寻址 散列函数 除法散列 乘法散列 全域散列 完全散列 碰撞处理方法 链表法 开放寻址法 线性探查 二次探查 双重散列 随机散列 再散列问题 完整源码(C++) 参考资料 内 ...

  10. 解决Ubuntu环境变量错误导致无法正常登录  (command 'xxx' is available in bin ls)

    一.问题产生 配置JDK时,按照搜索到的一篇文章中的做法,修改了/etc/profile文件里的内容.在原内容保持不变的基础上,大致添加了以下内容: export JAVA_HOME=.... exp ...