mirror of
https://github.com/xevidos/codiad.git
synced 2024-12-23 06:12: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
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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 ) {
|
||||||
|
|
Loading…
Reference in a new issue