From 0fd4f782ef83110e472972385691ba7746e0c65f Mon Sep 17 00:00:00 2001 From: xevidos Date: Sat, 23 Nov 2019 23:39:17 -0500 Subject: [PATCH] Continued work on new upload system --- components/filemanager/controller.php | 9 ++++++--- components/filemanager/init.js | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/components/filemanager/controller.php b/components/filemanager/controller.php index f00e9c2..9627125 100755 --- a/components/filemanager/controller.php +++ b/components/filemanager/controller.php @@ -286,8 +286,11 @@ switch( $action ) { break; case 'upload': - - if( ! isset( $_POST["blob"] ) ) { + + echo var_dump( $_GET ); + echo var_dump( $_POST ); + + if( ! isset( $_POST["data"] ) ) { $response["status"] = "error"; $response["data"] = array( @@ -296,7 +299,7 @@ switch( $action ) { exit( json_encode( $response ) ); } - $blob = $_POST["blob"]; + $blob = $_POST["data"]; $response = $Filemanager->upload( $path, $blob ); break; diff --git a/components/filemanager/init.js b/components/filemanager/init.js index 15efbe1..0452ca9 100755 --- a/components/filemanager/init.js +++ b/components/filemanager/init.js @@ -1658,7 +1658,21 @@ upload_blob: async function( blob, path ) { + let _this = codiad.filemanager; + let form = new FormData(); + form.append( 'path', path ); + form.append( 'data', blob ); + $.ajax({ + type: 'POST', + url: _this.controller + '?action=upload', + data: form, + processData: false, + contentType: false, + }).done( function( data ) { + + console.log( data ); + }); }, upload_blobs: function( file, path ) {