Continued work on new upload system

This commit is contained in:
xevidos 2019-11-23 23:39:17 -05:00
parent 988dde4a81
commit 0fd4f782ef
2 changed files with 20 additions and 3 deletions

View file

@ -287,7 +287,10 @@ switch( $action ) {
case 'upload': case 'upload':
if( ! isset( $_POST["blob"] ) ) { echo var_dump( $_GET );
echo var_dump( $_POST );
if( ! isset( $_POST["data"] ) ) {
$response["status"] = "error"; $response["status"] = "error";
$response["data"] = array( $response["data"] = array(
@ -296,7 +299,7 @@ switch( $action ) {
exit( json_encode( $response ) ); exit( json_encode( $response ) );
} }
$blob = $_POST["blob"]; $blob = $_POST["data"];
$response = $Filemanager->upload( $path, $blob ); $response = $Filemanager->upload( $path, $blob );
break; break;

View file

@ -1658,7 +1658,21 @@
upload_blob: async function( blob, path ) { 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 ) { upload_blobs: function( file, path ) {