File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -379,14 +379,23 @@ public function save() {
379379 $ resp ["token " ] = null ;
380380 }
381381
382+ $ callbackParams = array ("token " => $ resp ["token " ]);
382383 try {
383384 $ uploader = SimpleUploader::createUploader ($ resp ["provider " ]);
384385 $ uploader ->initialize ($ resp ["upload_url " ], $ resp ["token " ]);
385386 $ uploader ->upload ($ this ->_source , $ this ->getMimeType (), $ key );
387+ $ callbackParams ["result " ] = true ;
386388 } catch (\Exception $ ex ) {
387- $ this -> destroy () ;
389+ $ callbackParams [ " result " ] = false ;
388390 throw $ ex ;
391+ } finally {
392+ try {
393+ Client::post ("/fileCallback " , $ callbackParams );
394+ } catch (\Exception $ ex ) {
395+ error_log ("Request /fileCallback failed. " );
396+ }
389397 }
398+
390399 forEach (array ("upload_url " , "token " ) as $ k ) {
391400 if (isset ($ resp [$ k ])) {
392401 unset($ resp [$ k ]);
@@ -440,4 +449,3 @@ public function encode() {
440449 );
441450 }
442451}
443-
You can’t perform that action at this time.
0 commit comments