jaredramirez / elm-s3 Goto Github PK
View Code? Open in Web Editor NEWUploading files to S3 quick and easy
License: BSD 3-Clause "New" or "Revised" License
Uploading files to S3 quick and easy
License: BSD 3-Clause "New" or "Revised" License
As noted in the Discourse thread, due to Elm's Task
limitation, you cannot get the tracker from a Task
. Because I want to upload videos, and videos can be quite large, I want the ability to see the progress and cancel.
Currently the upload URL is constructed from the bucket name and the AWS host:
url =
interpolate """https://{0}.{1}"""
[ record.bucket
, record.awsS3Host
]
This doesn’t work for buckets that have dots (.
) in their names. According to this it should be possible to use an alternate URL format to upload:
https://s3-{region-name}.amazonaws.com/{bucket-name}
This has the advantage of working even for buckets with dots. Could we switch to this URL format?
When I don’t set an explicit prefix using S3.withPrefix
(or start the prefix with a slash), a “invisible” no-name top-level folder is created in the bucket. I think the problem is in the uploadFileTask
function, assembling the key:
key =
interpolate "{0}/{1}"
[ record.prefix
, fileData.fileName
]
This makes total sense – except it seems that somewhere along the way another slash gets prepended to the key. This means that with an empty prefix, the key gets set to "/filename"
and later to "//filename"
, which S3 happily inflates into a no-name folder as can be seen in the S3 Management Console. (Same thing happens if there is a prefix, but starts with a slash.)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.