Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uppy-s3_multipart
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
uppy-s3_multipart
Commits
01359db9
Unverified
Commit
01359db9
authored
Oct 13, 2018
by
Janko Marohnić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More README fixes
parent
ea0baf52
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
23 deletions
+21
-23
README.md
README.md
+21
-23
No files found.
README.md
View file @
01359db9
...
@@ -97,20 +97,31 @@ POST /s3/multipart/:uploadId/complete
...
@@ -97,20 +97,31 @@ POST /s3/multipart/:uploadId/complete
DELETE /s3/multipart/:uploadId
DELETE /s3/multipart/:uploadId
```
```
Finally, in your Uppy configuration set
`serverUrl`
to your app's URL or an
Finally, in your Uppy configuration set
`serverUrl`
to your app's URL:
empty string:
```
js
```
js
// ...
// ...
uppy
.
use
(
Uppy
.
AwsS3Multipart
,
{
uppy
.
use
(
Uppy
.
AwsS3Multipart
,
{
serverUrl
:
''
,
// uses relative URLs (pass 'https://your-app.com' for absolute URLs)
serverUrl
:
window
.
location
.
origin
,
// your application
})
uppy
.
on
(
'upload-success'
,
function
(
file
,
data
,
uploadURL
)
{
var
uploadedFileData
=
JSON
.
stringify
({
id
:
uploadURL
.
match
(
/
\/
cache
\/([^\?]
+
)
/
)[
1
],
// extract key without prefix
storage
:
'cache'
,
metadata
:
{
size
:
file
.
size
,
filename
:
file
.
name
,
mime_type
:
file
.
type
,
}
})
// ...
})
})
```
```
**
See
[
Adding Direct S3 Uploads
]
for an example of a complete Uppy setup with
**
See
[
Adding Direct S3 Uploads
]
for an example of a complete Uppy setup with
Shrine. From there you can just swap the
`AwsS3`
Uppy plugin for the
Shrine. From there you can swap the
`presign_endpoint`
+
`AwsS3`
code with the
`AwsS3Multipart`
plugin, and
`presign_endpoint`
Shrine plugin for the
`uppy_s3_multipart`
+
`AwsS3Multipart`
setup.
**
`uppy_s3_multipart`
plugin.
**
Both the plugin and method accepts
`:options`
for specifying additional options
Both the plugin and method accepts
`:options`
for specifying additional options
to the aws-sdk calls (read further for more details on these options):
to the aws-sdk calls (read further for more details on these options):
...
@@ -134,7 +145,8 @@ instructions on how to opt in.
...
@@ -134,7 +145,8 @@ instructions on how to opt in.
### Standalone
### Standalone
You can also initialize
`Uppy::S3Multipart::App`
directly:
You can also use
`uppy-s3_multipart`
without Shrine. Start by initializing the
`Uppy::S3Multipart::App`
directly:
```
rb
```
rb
require
"uppy/s3_multipart"
require
"uppy/s3_multipart"
...
@@ -164,26 +176,12 @@ map "/s3" do
...
@@ -164,26 +176,12 @@ map "/s3" do
end
end
```
```
In your Uppy configuration set
`serverUrl`
to your app's URL or an empty
In your Uppy configuration set
`serverUrl`
to your app's URL:
string:
```
js
```
js
// ...
// ...
uppy
.
use
(
Uppy
.
AwsS3Multipart
,
{
uppy
.
use
(
Uppy
.
AwsS3Multipart
,
{
serverUrl
:
window
.
location
.
origin
,
// current scheme + host + port
serverUrl
:
window
.
location
.
origin
,
// your application
})
uppy
.
on
(
'upload-success'
,
function
(
file
,
data
,
uploadURL
)
{
var
uploadedFileData
=
JSON
.
stringify
({
id
:
uploadURL
.
match
(
/
\/
cache
\/([^\?]
+
)
/
)[
1
],
// extract key without prefix
storage
:
'cache'
,
metadata
:
{
size
:
file
.
size
,
filename
:
file
.
name
,
mime_type
:
file
.
type
,
}
})
// ...
})
})
```
```
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment