Permalink
Browse files

fixed a bug impacting small files

  • Loading branch information...
1 parent 642dea2 commit 5cd30312def04268948c2343554a44941d0d5b5b @maxgillett committed Mar 31, 2013
View
@@ -6,7 +6,9 @@ Multipart uploading allows files to be split into many chunks and uploaded in pa
## What's New
-**0.0.10.2** - Fixed some bugs. Modifications made to the database table used by the gem are now handled by migrations. If you are upgrading versions, run `rails g s3_multipart:install_new_migrations` followed by `rake db:migrate`. Fresh installs do not require subsequent migrations. The current version must now also be passed in to the gem's configuration function to alert you of breaking changes. This is done by setting a revision yml variable. See the section regarding the aws.yml file in the readme section below (just before "Getting Started").
+**0.0.10.3** - Fixed a bug that prevented 5-10mb files from being uploaded correctly.
+
+**0.0.10.2** - Modifications made to the database table used by the gem are now handled by migrations. If you are upgrading versions, run `rails g s3_multipart:install_new_migrations` followed by `rake db:migrate`. Fresh installs do not require subsequent migrations. The current version must now also be passed in to the gem's configuration function to alert you of breaking changes. This is done by setting a revision yml variable. See the section regarding the aws.yml file in the readme section below (just before "Getting Started").
**0.0.9** - File type and size validations are now specified in the upload controller. Untested support for browsers that lack the FileBlob API
View
@@ -26,9 +26,15 @@ function Upload(file, o, key) {
} else if (this.size > 100000000) { // greater than 100 mb
num_segs = 20;
pipes = 5;
- } else { // greater than 5 mb (S3 does not allow multipart uploads < 5 mb)
+ } else if (this.size > 50000000) { // greater than 50 mb
+ num_segs = 5;
+ pipes = 2;
+ } else if (this.size > 10000000) { // greater than 10 mb
num_segs = 2;
pipes = 2;
+ } else { // greater than 5 mb (S3 does not allow multipart uploads < 5 mb)
+ num_segs = 1;
+ pipes = 1;
}
chunk_segs = _.range(num_segs + 1);
@@ -1,5 +1,5 @@
module S3Multipart
- VERSION = "0.0.10.2"
+ VERSION = "0.0.10.3"
BREAKING_CHANGES = {
:"0.0.10.2" => 'Modifications made to the database table used by the gem are now handled by migrations. If you are upgrading versions, run `rails g s3_multipart:install_new_migrations` followed by `rake db:migrate`. Fresh installs do not require subsequent migrations. The current version must now also be passed in to the gem\'s configuration function to alert you of breaking changes. This is done by setting a revision yml variable. See the section regarding the aws.yml file in the readme section below (just before "Getting Started").'
}
View
@@ -1,6 +1,6 @@
{
"name": "s3_multipart",
- "version": "0.0.8",
+ "version": "0.0.10.3",
"devDependencies": {
"grunt": "latest",
"grunt-contrib-uglify": "latest",
@@ -31,7 +31,7 @@ describe("An upload", function() {
file = {
name: 'test.mkv',
- size: 7500000,
+ size: 15000000,
type: 'video/mkv'
};
@@ -72,4 +72,4 @@ describe("An upload", function() {
});
-});
+});
@@ -369,9 +369,15 @@ function Upload(file, o, key) {
} else if (this.size > 100000000) { // greater than 100 mb
num_segs = 20;
pipes = 5;
- } else { // greater than 5 mb (S3 does not allow multipart uploads < 5 mb)
+ } else if (this.size > 50000000) { // greater than 50 mb
+ num_segs = 5;
+ pipes = 2;
+ } else if (this.size > 10000000) { // greater than 10 mb
num_segs = 2;
pipes = 2;
+ } else { // greater than 5 mb (S3 does not allow multipart uploads < 5 mb)
+ num_segs = 1;
+ pipes = 1;
}
chunk_segs = _.range(num_segs + 1);

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 5cd3031

Please sign in to comment.