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
DELETE /s3/multipart/:uploadId
```
Finally, in your Uppy configuration set
`serverUrl`
to your app's URL or an
empty string:
Finally, in your Uppy configuration set
`serverUrl`
to your app's URL:
```
js
// ...
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
Shrine. From there you can just swap the
`AwsS3`
Uppy plugin for the
`AwsS3Multipart`
plugin, and
`presign_endpoint`
Shrine plugin for the
`uppy_s3_multipart`
plugin.
**
Shrine. From there you can swap the
`presign_endpoint`
+
`AwsS3`
code with the
`uppy_s3_multipart`
+
`AwsS3Multipart`
setup.
**
Both the plugin and method accepts
`:options`
for specifying additional options
to the aws-sdk calls (read further for more details on these options):
...
...
@@ -134,7 +145,8 @@ instructions on how to opt in.
### 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
require
"uppy/s3_multipart"
...
...
@@ -164,26 +176,12 @@ map "/s3" do
end
```
In your Uppy configuration set
`serverUrl`
to your app's URL or an empty
string:
In your Uppy configuration set
`serverUrl`
to your app's URL:
```
js
// ...
uppy
.
use
(
Uppy
.
AwsS3Multipart
,
{
serverUrl
:
window
.
location
.
origin
,
// current scheme + host + port
})
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
,
}
})
// ...
serverUrl
:
window
.
location
.
origin
,
// your application
})
```
...
...
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