diff --git a/app/helpers/upload_form_helper.rb b/app/helpers/upload_form_helper.rb index fc46645388..d3eeda947c 100644 --- a/app/helpers/upload_form_helper.rb +++ b/app/helpers/upload_form_helper.rb @@ -39,4 +39,12 @@ def upload_form_data {} end end + + # def multipart_upload_data + # if direct_upload? + # bucket = Aws::S3::Bucket.new(name: Settings.encoding.masterfile_bucket) + # multipart_upload = Aws::S3::Client.new.create_multipart_upload(bucket: bucket.name, key: 'lo') + # { 'upload_id' => multipart_upload[:upload_id] } + # end + # end end diff --git a/app/javascript/components/FileUploadUppy.jsx b/app/javascript/components/FileUploadUppy.jsx index 0128dd69e5..759c640f78 100755 --- a/app/javascript/components/FileUploadUppy.jsx +++ b/app/javascript/components/FileUploadUppy.jsx @@ -4,6 +4,7 @@ import { Dashboard } from '@uppy/react'; import ActiveStorageUpload from '@excid3/uppy-activestorage-upload'; import GoogleDrive from '@uppy/google-drive'; import AwsS3 from '@uppy/aws-s3'; +import AwsS3Multipart from '@uppy/aws-s3-multipart'; require('@uppy/core/dist/style.css') require('@uppy/dashboard/dist/style.css') @@ -33,7 +34,14 @@ class FileUploadUppy extends React.Component { .use(GoogleDrive, { companionUrl: 'http://localhost:3020' }) + // .use(AwsS3Multipart, { + // limit: 5, + // timeout: 60*1000, // set to 1min + // companionUrl: '/', + // }) .use(AwsS3, { + limit: 5, + timeout: 60*1000, // set to 1min companionUrl: 'http://localhost:3020', getUploadParameters() { return Promise.resolve({ @@ -69,9 +77,11 @@ class FileUploadUppy extends React.Component { headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, body: formData }) - .then(res => { }) + .then(res => { + location.reload(); + }) .catch(error => { - console.error('MasterFile create failed, ', error); + console.error('MasterFile creation failed, ', error); }); } }); diff --git a/app/models/master_file.rb b/app/models/master_file.rb index 3d1e3e4621..565f6d1260 100644 --- a/app/models/master_file.rb +++ b/app/models/master_file.rb @@ -177,7 +177,7 @@ def error # be set up in a configuration file somewhere # # 250 MB is the file limit for now - MAXIMUM_UPLOAD_SIZE = Settings.max_upload_size || 2.gigabytes + MAXIMUM_UPLOAD_SIZE = Settings.max_upload_size || 5.gigabytes WORKFLOWS = ['fullaudio', 'avalon', 'pass_through', 'avalon-skip-transcoding', 'avalon-skip-transcoding-audio'].freeze AUDIO_TYPES = ["audio/vnd.wave", "audio/mpeg", "audio/mp3", "audio/mp4", "audio/wav", "audio/x-wav"] diff --git a/package.json b/package.json index f505269546..4509c55358 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "@rails/webpacker": "^5.2.2", "@samvera/iiif-react-media-player": "1.2.1", "@uppy/aws-s3": "^3.0.4", + "@uppy/aws-s3-multipart": "^3.1.1", "@uppy/companion": "^4.0.5", "@uppy/core": "^3.0.4", "@uppy/dashboard": "^3.1.0", diff --git a/yarn.lock b/yarn.lock index b055006f15..fc877e2211 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1507,6 +1507,14 @@ dependencies: "@types/node" "*" +"@uppy/aws-s3-multipart@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@uppy/aws-s3-multipart/-/aws-s3-multipart-3.1.1.tgz#996184d7c73122d9a33b166e2960215e482e57ab" + integrity sha512-vL4QtbI5T4cGJLHm2GzKIGeaiy2zbgNW0nn/3LxYQ+wrBHLJoVZ/6uzMiFdNUBNa28rRQ/qxWTmy/kD6co95cg== + dependencies: + "@uppy/companion-client" "^3.1.1" + "@uppy/utils" "^5.1.1" + "@uppy/aws-s3@^3.0.4": version "3.0.4" resolved "https://registry.yarnpkg.com/@uppy/aws-s3/-/aws-s3-3.0.4.tgz#a2422a2091c57570ff99a77108296f09ba9e46a5" @@ -1525,6 +1533,14 @@ "@uppy/utils" "^5.0.2" namespace-emitter "^2.0.1" +"@uppy/companion-client@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@uppy/companion-client/-/companion-client-3.1.1.tgz#8c9974f70b899a40771da9a90113941356f9842e" + integrity sha512-S1M37vjWu8gdOgdI3Hh/1fVZ9GaLdyPQjVyUujZDTsr79b4VG7v/zjdqJ0FiOTjfGbpnj8s9kr1uyYi0Zf5VFw== + dependencies: + "@uppy/utils" "^5.1.1" + namespace-emitter "^2.0.1" + "@uppy/companion@^4.0.5": version "4.0.5" resolved "https://registry.yarnpkg.com/@uppy/companion/-/companion-4.0.5.tgz#ee448848fdd38d28747f6aec41eb365cb4143e3e" @@ -1690,6 +1706,13 @@ dependencies: lodash.throttle "^4.1.1" +"@uppy/utils@^5.1.1": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@uppy/utils/-/utils-5.1.1.tgz#9597e8696e17d71413672bd56eb082c7410514a3" + integrity sha512-uoI+PcIVQboky0ZbN4PQeK1seZnnJocomzeK7blId9HKJ6QNgZLf2ibk2CQuQxrOuNsWhgrhs5uLO5Si0oM0Yw== + dependencies: + lodash.throttle "^4.1.1" + "@uppy/xhr-upload@^3.0.4": version "3.0.4" resolved "https://registry.yarnpkg.com/@uppy/xhr-upload/-/xhr-upload-3.0.4.tgz#219a92c832bee1f089992958d27ec71dbe9d9d7d"