diff options
author | zotlabs <mike@macgirvin.com> | 2017-11-28 17:37:18 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-11-28 17:37:18 -0800 |
commit | 76703dee8481075a44b254a548bb29b49530d0ad (patch) | |
tree | b357716a3b0d1dc39b3855fe1839dbf03aa4ba7a | |
parent | df45c13f622d01241ac96b2f16cb964ba688d72c (diff) | |
download | volse-hubzilla-76703dee8481075a44b254a548bb29b49530d0ad.tar.gz volse-hubzilla-76703dee8481075a44b254a548bb29b49530d0ad.tar.bz2 volse-hubzilla-76703dee8481075a44b254a548bb29b49530d0ad.zip |
more chunk work
-rw-r--r-- | Zotlabs/Module/File_upload.php | 5 | ||||
-rw-r--r-- | include/attach.php | 2 | ||||
-rw-r--r-- | view/js/mod_cloud.js | 44 | ||||
-rw-r--r-- | view/tpl/cloud_actionspanel.tpl | 2 |
4 files changed, 29 insertions, 24 deletions
diff --git a/Zotlabs/Module/File_upload.php b/Zotlabs/Module/File_upload.php index 296dab708..e2a6d45e5 100644 --- a/Zotlabs/Module/File_upload.php +++ b/Zotlabs/Module/File_upload.php @@ -10,7 +10,8 @@ class File_upload extends \Zotlabs\Web\Controller { function post() { - // logger('file upload: ' . print_r($_REQUEST,true)); + logger('file upload: ' . print_r($_REQUEST,true)); + logger('file upload: ' . print_r($_FILES,true)); $channel = (($_REQUEST['channick']) ? channelx_by_nick($_REQUEST['channick']) : null); @@ -56,7 +57,7 @@ class File_upload extends \Zotlabs\Web\Controller { if(array_key_exists('HTTP_CONTENT_RANGE',$_SERVER)) { $pm = preg_match('/bytes (\d*)\-(\d*)\/(\d*)/',$_SERVER['HTTP_CONTENT_RANGE'],$matches); if($pm) { - // logger('Content-Range: ' . print_r($matches,true)); + logger('Content-Range: ' . print_r($matches,true)); $partial = true; } } diff --git a/include/attach.php b/include/attach.php index 5b4c24f6f..86c792ed9 100644 --- a/include/attach.php +++ b/include/attach.php @@ -2506,7 +2506,7 @@ function save_chunk($channel,$start,$end,$len) { } if(($len - 1) == $end) { unlink($tmp_path); - $result['name'] = $_FILES['files']['tmp_name']; + $result['name'] = $_FILES['files']['name']; $result['type'] = $_FILES['files']['type']; $result['tmp_name'] = $new_path; $result['error'] = 0; diff --git a/view/js/mod_cloud.js b/view/js/mod_cloud.js index 32aae2029..25f40e5a5 100644 --- a/view/js/mod_cloud.js +++ b/view/js/mod_cloud.js @@ -18,26 +18,28 @@ function UploadInit() { var submit = $("#upload-submit"); - $('#invisible-cloud-file-upload').fileupload({ + $('#files-upload').fileupload({ url: 'file_upload', dataType: 'json', - // dropZone: $('#profile-jot-text'), - maxChunkSize: 4 * 1024 * 1024, + dropZone: filedrag, + maxChunkSize: 100000, // 4 * 1024 * 1024, + add: function(e,data) { $('#profile-rotator').show(); data.submit(); }, - done: function(e,data) { - addeditortext(data.result.message); - $('#jot-media').val($('#jot-media').val() + data.result.message); - }, - stop: function(e,data) { - preview_post(); - $('#profile-rotator').hide(); - }, + +// done: function(e,data) { +// addeditortext(data.result.message); +// $('#jot-media').val($('#jot-media').val() + data.result.message); +// }, +// stop: function(e,data) { +// preview_post(); +// $('#profile-rotator').hide(); +// }, }); - $('#files-upload').click(function(event) { event.preventDefault(); $('#invisible-cloud-file-upload').trigger('click'); return false;}); +// $('#files-upload').click(function(event) { event.preventDefault(); $('#invisible-cloud-file-upload').trigger('click'); return false;}); @@ -185,6 +187,8 @@ function getIconFromType(type) { // upload files function UploadFile(file, idx) { + return; + window.filesToUpload = window.filesToUpload + 1; var xhr = new XMLHttpRequest(); @@ -229,15 +233,15 @@ function UploadFile(file, idx) { }); // POST to the entire cloud path - xhr.open('post', 'file_upload', true); +// xhr.open('post', 'file_upload', true); - var formfields = $("#ajax-upload-files").serializeArray(); +// var formfields = $("#ajax-upload-files").serializeArray(); - var data = new FormData(); - $.each(formfields, function(i, field) { - data.append(field.name, field.value); - }); - data.append('userfile', file); +// var data = new FormData(); +// $.each(formfields, function(i, field) { +// data.append(field.name, field.value); +// }); +// data.append('userfile', file); - xhr.send(data); +// xhr.send(data); } diff --git a/view/tpl/cloud_actionspanel.tpl b/view/tpl/cloud_actionspanel.tpl index fc3e7f82f..489632a4a 100644 --- a/view/tpl/cloud_actionspanel.tpl +++ b/view/tpl/cloud_actionspanel.tpl @@ -25,7 +25,7 @@ <input type="hidden" name="channick" value="{{$channick}}" /> <input type="hidden" name="return_url" value="{{$return_url}}" /> <label for="files-upload">{{$upload_header}}</label> - <input class="form-group pull-left" id="files-upload" type="file" name="userfile"> + <input class="form-group pull-left" id="files-upload" type="file" multiple name="files"> {{include file="field_checkbox.tpl" field=$notify}} <div class="pull-right btn-group"> <div class="btn-group"> |