File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed
src/shared/containers/SubmissionManagement Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ module.exports = {
116
116
FORUMS_VANILLA : 'https://vanilla.topcoder-dev.com' ,
117
117
HELP : 'https://www.topcoder.com/thrive/tracks?track=Topcoder&tax=Help%20Articles' ,
118
118
SUBMISSION_REVIEW : 'https://submission-review.topcoder-dev.com' ,
119
+ SUBMISSION_REVIEW_API_URL : 'https://submission-review-api.topcoder-dev.com' ,
119
120
120
121
THRIVE : 'https://community-app.topcoder-dev.com/thrive' ,
121
122
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ module.exports = {
35
35
FORUMS_VANILLA : 'https://discussions.topcoder.com' ,
36
36
HELP : 'https://www.topcoder.com/thrive/tracks?track=Topcoder&tax=Help%20Articles' ,
37
37
SUBMISSION_REVIEW : 'https://submission-review.topcoder.com' ,
38
+ SUBMISSION_REVIEW_API_URL : 'https://submission-review-api.topcoder.com' ,
38
39
MEMBER : 'https://member.topcoder.com' ,
39
40
ONLINE_REVIEW : 'https://software.topcoder.com' ,
40
41
PAYMENT_TOOL : 'https://payment.topcoder.com' ,
Original file line number Diff line number Diff line change @@ -70,17 +70,16 @@ class SubmissionManagementPageContainer extends React.Component {
70
70
onShowDetails,
71
71
onDelete : onSubmissionDelete ,
72
72
onDownload : ( challengeType , submissionId ) => {
73
- const submissionsService = getService ( authTokens . tokenV3 ) ;
74
- submissionsService . downloadSubmission ( submissionId )
75
- . then ( ( blob ) => {
76
- const url = window . URL . createObjectURL ( new Blob ( [ blob ] ) ) ;
77
- const link = document . createElement ( 'a' ) ;
78
- link . href = url ;
79
- link . setAttribute ( 'download' , `submission-${ challengeType } -${ submissionId } .zip` ) ;
80
- document . body . appendChild ( link ) ;
81
- link . click ( ) ;
82
- link . parentNode . removeChild ( link ) ;
83
- } ) ;
73
+ // download large file using stream method
74
+ const downloadSubmissionURL = `${ config . URL . SUBMISSION_REVIEW_API_URL } /challengeSubmissions/${ submissionId } /download?token=${ authTokens . tokenV3 } ` ;
75
+
76
+ const link = document . createElement ( 'a' ) ;
77
+ link . href = downloadSubmissionURL ;
78
+ link . setAttribute ( 'download' , `submission-${ challengeType } -${ submissionId } .zip` ) ;
79
+
80
+ document . body . appendChild ( link ) ;
81
+ link . click ( ) ;
82
+ link . parentNode . removeChild ( link ) ;
84
83
} ,
85
84
onlineReviewUrl : `${ config . URL . ONLINE_REVIEW } /review/actions/ViewProjectDetails?pid=${ challengeId } ` ,
86
85
challengeUrl : `${ challengesUrl } /${ challengeId } ` ,
You can’t perform that action at this time.
0 commit comments