Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# History
----

### 3.0.0

- Drop support of IE8/9.

### 2.9.0

- Support `method`. #197
Expand Down
25 changes: 1 addition & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ online example: http://react-component.github.io/upload/examples/simple.html

## Feature

* support ie8,ie8+,chrome,firefox,safari
* support IE11+, Chrome, Firefox, Safari

## install

Expand All @@ -58,7 +58,6 @@ React.render(<Upload />, container);
|className | string | - | root component className |
|disabled | boolean | false | whether disabled |
|component | "div"|"span" | "span"| wrap component name |
|supportServerRender | boolean | false| whether to support server render |
|onReady | function | | only call when supportServerRender is true, upload is rendered completely |
|action| string &#124; function(file): string &#124; Promise&lt;string&gt; | | form action url |
|method | string | post | request method |
Expand Down Expand Up @@ -112,28 +111,6 @@ customRequest callback is passed an object with:

abort(file?: File) => void: abort the uploading file


### IE8/9 Note

#### Download Popup Problem

In iframe uploader way, the content-type of response should be `text/plain` or `text/html`. [See more about
Content-Type Negotiation](https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation)

What's more, in iframe mode, the response's status should always be `200 OK`, otherwise you might get an `Access is denied` error in IE 8/9.

#### Domain Problem

If the Page set document.domain, then server should output document.domain according to _documentDomain parameter.

```js
var ret = '';
if (postData._documentDomain) {
ret += '<script>document.domain="'+postData._documentDomain+'";</script>';
}
this.body = ret + '{"url":"xx.jpq"}';
```

## License

rc-upload is released under the MIT license.
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rc-upload",
"version": "2.9.4",
"version": "3.0.0-alpha.0",
"description": "upload ui component for react",
"keywords": [
"react",
Expand Down Expand Up @@ -54,9 +54,7 @@
],
"dependencies": {
"babel-runtime": "6.x",
"classnames": "^2.2.5",
"prop-types": "^15.5.7",
"warning": "4.x"
"classnames": "^2.2.5"
},
"jest": {
"collectCoverageFrom": [
Expand Down
33 changes: 1 addition & 32 deletions src/AjaxUploader.jsx
Original file line number Diff line number Diff line change
@@ -1,43 +1,12 @@
/* eslint react/no-is-mounted:0 react/sort-comp:0 */

/* eslint react/no-is-mounted:0,react/sort-comp:0,react/prop-types:0 */
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import defaultRequest from './request';
import getUid from './uid';
import attrAccept from './attr-accept';
import traverseFileTree from './traverseFileTree';

class AjaxUploader extends Component {
static propTypes = {
id: PropTypes.string,
component: PropTypes.string,
style: PropTypes.object,
prefixCls: PropTypes.string,
className: PropTypes.string,
multiple: PropTypes.bool,
directory: PropTypes.bool,
disabled: PropTypes.bool,
accept: PropTypes.string,
children: PropTypes.any,
onStart: PropTypes.func,
data: PropTypes.oneOfType([
PropTypes.object,
PropTypes.func,
]),
action: PropTypes.oneOfType([
PropTypes.string,
PropTypes.func,
]),
headers: PropTypes.object,
beforeUpload: PropTypes.func,
customRequest: PropTypes.func,
onProgress: PropTypes.func,
withCredentials: PropTypes.bool,
openFileDialogOnClick: PropTypes.bool,
transformFile: PropTypes.func,
}

state = { uid: getUid() }

reqs = {}
Expand Down
Loading