upload-js
Advanced tools
Comparing version 2.7.1 to 2.8.0
@@ -686,2 +686,3 @@ module.exports = | ||
originalFileName: file.name, | ||
protocol: "1.1", | ||
size: file.size, | ||
@@ -693,3 +694,2 @@ tags: params.tags | ||
var uploadMetadata = handleApiResult(_beginMultipartUpload); | ||
var isMultipart = uploadMetadata.uploadParts.count > 1; | ||
debug("Initiated file upload. Metadata = ".concat(JSON.stringify(uploadMetadata))); | ||
@@ -754,3 +754,3 @@ | ||
return _await(uploadPart(file, uploadMetadata.file, isMultipart, nextPart, progress, addCancellationHandler, workerIndex), function () { | ||
return _await(uploadPart(file, nextPart, progress, addCancellationHandler, workerIndex), function () { | ||
return Upload_awaitIgnored(uploadNextPart(workerIndex)); | ||
@@ -777,3 +777,3 @@ }); | ||
var putUploadPart = Upload_async(function (url, summary, isMultipart, content, progress, addCancellationHandler) { | ||
var putUploadPart = Upload_async(function (url, content, progress, addCancellationHandler) { | ||
var xhr = new XMLHttpRequest(); | ||
@@ -830,12 +830,3 @@ var pending = true; | ||
xhr.open("PUT", url); // Headers are set by the BE for multipart uploads. | ||
if (!isMultipart) { | ||
xhr.setRequestHeader("content-type", summary.mime); | ||
if (summary.originalFileName !== null) { | ||
xhr.setRequestHeader("content-disposition", "inline; filename=\"".concat(encodeURIComponent(summary.originalFileName), "\"; filename*=UTF-8''").concat(encodeURIComponent(summary.originalFileName))); | ||
} | ||
} | ||
xhr.open("PUT", url); | ||
xhr.send(content); | ||
@@ -849,6 +840,6 @@ })); | ||
var uploadPart = Upload_async(function (file, summary, isMultipart, part, progress, addCancellationHandler, workerIndex) { | ||
var uploadPart = Upload_async(function (file, part, progress, addCancellationHandler, workerIndex) { | ||
var content = part.range.inclusiveEnd === -1 ? new Blob() : file.slice(part.range.inclusiveStart, part.range.inclusiveEnd + 1); | ||
debug("Uploading part ".concat(part.uploadPartIndex, "."), workerIndex); | ||
return _await(putUploadPart(part.uploadUrl, summary, isMultipart, content, progress, addCancellationHandler), function (_ref2) { | ||
return _await(putUploadPart(part.uploadUrl, content, progress, addCancellationHandler), function (_ref2) { | ||
var etag = _ref2.etag; | ||
@@ -855,0 +846,0 @@ return _await((0,upload_api_client_upload_js_namespaceObject.completeUploadPart)(getConfig(), accountId, part.uploadId, part.uploadPartIndex, { |
{ | ||
"name": "upload-js", | ||
"version": "2.7.1", | ||
"version": "2.8.0", | ||
"author": "Upload <hello@upload.io> (https://upload.io)", | ||
@@ -45,3 +45,3 @@ "description": "File Upload Library — Upload.js gives developers AJAX multipart file uploading via XHR 🚀 Comes with Cloud Storage 🌐", | ||
"dependencies": { | ||
"@upload-io/upload-api-client-upload-js": "^2.13.0", | ||
"@upload-io/upload-api-client-upload-js": "^2.14.0", | ||
"progress-smoother": "^1.4.0" | ||
@@ -48,0 +48,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73262
1412