Skip to content

Commit

Permalink
Merge pull request #1355 from vinsonliux/dropzonem-maxfilesize
Browse files Browse the repository at this point in the history
Dropzonem maxfilesize
  • Loading branch information
pierotofy committed Jun 19, 2023
2 parents a290b7a + 397117f commit 849ae65
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/static/app/js/components/ProjectListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ class ProjectListItem extends React.Component {
autoProcessQueue: false,
createImageThumbnails: false,
clickable: this.uploadButton,
maxFilesize: 131072, // 128G
chunkSize: 2147483647,
timeout: 2147483647,

Expand Down Expand Up @@ -215,6 +216,14 @@ class ProjectListItem extends React.Component {

try{
if (file.status === "error"){
if ((file.size / 1024) > this.dz.options.maxFilesize) {
// Delete from upload queue
this.setUploadState({
totalCount: this.state.upload.totalCount - 1,
totalBytes: this.state.upload.totalBytes - file.size
});
throw new Error(interpolate(_('Cannot upload %(filename)s, File too Large! Default MaxFileSize is %(maxFileSize)s MB!'), { filename: file.name, maxFileSize: this.dz.options.maxFilesize }));
}
retry();
}else{
// Check response
Expand Down

0 comments on commit 849ae65

Please sign in to comment.