mirror of
https://github.com/xevidos/codiad.git
synced 2024-12-22 13:52:16 +01:00
Continued work on new upload system
This commit is contained in:
parent
988dde4a81
commit
0fd4f782ef
2 changed files with 20 additions and 3 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in a new issue