Comments (1)
比较常用的ajax上传方法:
var img = document.getElementById('img').files[0];
var formData = new FormData();
formData.append('img',img);
然后使用ajax上传,不过要注意的是使用POST发送,最好设置
processData :false, // 不处理发送的数据,因为data值是Formdata对象,不需要对数据做处理
contentType :false, // 不设置Content-type请求头
from gitment.
Related Issues (20)
- vue学习笔记 | 花开半夏
- 原生js实现类Set结构 | 花开半夏
- Markdown一些简单常用的使用语法 | 花开半夏
- isNaN的使用 | 花开半夏
- ubuntu初体验(长期更新) | 花开半夏
- js运算整理 | 花开半夏
- All categories | 花开半夏
- ubuntu初体验(长期更新) | 花开半夏
- js类型转换 | 花开半夏
- react-native中的flex布局 | 花开半夏
- linux的常用命令 | 花开半夏
- css 三列布局 | 花开半夏
- linux问题解决(长期更新) | 花开半夏
- linux问题解决(长期更新) | 花开半夏
- All categories | 花开半夏
- All categories | 花开半夏
- All tags | 花开半夏
- 移动端1px问题的解决方案 | 花开半夏
- 移动端1px问题的解决方案 | 花开半夏
- javascript 中常用的几种设计模式 | 花开半夏
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitment.