|
@@ -49,7 +49,20 @@ We’ve also added a handy “cancel” button, which should cancel everything i
|
|
|
|
|
|
## XHR Response Handling
|
|
|
|
|
|
-When the upload completes (regardless of whether it succeeded), a `response` key gets added to the file. `file.response` contains a `status` and `data` properties. `data` is the result of `getResponseData()`.
|
|
|
+When the upload completes (regardless of whether it succeeded), a `response` key gets added to the file. `file.response` contains a `status` and `data` properties. `data` is the result of the `getResponseData()` option. The `getResponseData()` function's signature is now:
|
|
|
+
|
|
|
+```js
|
|
|
+getResponseData (responseText, response) { }
|
|
|
+```
|
|
|
+
|
|
|
+The `responseText` is the XHR endpoint response as a string. For uploads from the user's device, `response` is the [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) object.
|
|
|
+
|
|
|
+When uploading files from remote providers such as Dropbox or Instagram, Uppy Server sends upload response data to the client. This is made available in the `getResponseData()` option as well. The `response` object from Uppy Server contains some properties named after their [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) counterparts:
|
|
|
+
|
|
|
+ - `response.responseText` - the XHR endpoint response as a string;
|
|
|
+ - `response.status` - the HTTP status code;
|
|
|
+ - `response.statusText` - the HTTP status text;
|
|
|
+ - `response.headers` - an object mapping lowercase header names to their values.
|
|
|
|
|
|
## Powered by Uppy
|
|
|
|
|
@@ -65,7 +78,7 @@ This is entirely optional of course, just set `proudlyDisplayPoweredByUppy: fals
|
|
|
- There’s now an option `showLinkToFileUploadResult: true` to disable linking to the upload result in Dashboard UI.
|
|
|
- We are now using the image time and date as a file name in Instagram.
|
|
|
- URL plugin checks for http(s) protocol, and add http by default if no protocol is present.
|
|
|
-— It’s now possible to overrid `<DashboardModal />` React component’s target prop.
|
|
|
+- It’s now possible to override `<DashboardModal />` React component’s target prop.
|
|
|
- Provider views now have `showFilter` and `showBreadcrumbs` options, those are off for Instagram plugin, for example.
|
|
|
- Uppy Server to Client communication has been refactored into `Provider` and `Request` modules. Request can be used when a simple request needs to be made to Uppy Server, like in URL plugin, for example. Provider is used for more complex implementations shared between Google Drive and Instagram, for example.
|
|
|
- We’ve added Transloadit example to the website, [check it out](https://uppy.io/examples/transloadit/).
|