mirror of
https://github.com/easy-wi/developer.git
synced 2025-02-20 11:23:28 +08:00
FIX #954 MonstaFTP and empty files
This commit is contained in:
parent
7a1402feee
commit
12d6dbf77a
@ -183,8 +183,11 @@ function processFileUploads(e,isDrop,isFolder,globalFiles) {
|
||||
|
||||
// Count files to upload
|
||||
globalFileUploadPreCount=0;
|
||||
|
||||
for (var i=0; i<items.length; i++) {
|
||||
|
||||
var item = items[i].webkitGetAsEntry();
|
||||
|
||||
traverseFileTree(item,"");
|
||||
}
|
||||
|
||||
@ -525,9 +528,6 @@ function fileUploader(globalFiles,filePath,rowID,isFolder,isDrop) {
|
||||
progressBar = document.getElementById('progress'+rowID);
|
||||
progressBar.value = (e.loaded / e.total) * 100;
|
||||
|
||||
// Set the progress bar
|
||||
//progressBar.innerHTML = Math.round(progressBar.value)+'%'; // Display % for unsupported browsers
|
||||
|
||||
// Display %age complete
|
||||
document.getElementById('percent'+rowID).innerHTML = Math.round(progressBar.value) + '%';
|
||||
}
|
||||
@ -540,7 +540,6 @@ function fileUploader(globalFiles,filePath,rowID,isFolder,isDrop) {
|
||||
xmlhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest");
|
||||
xmlhttp.setRequestHeader("X-File-Size", file.size);
|
||||
xmlhttp.setRequestHeader("X-File-Type", file.type);
|
||||
xmlhttp.setRequestHeader("Content-Type", "multipart/form-data");
|
||||
xmlhttp.send(file);
|
||||
}
|
||||
}
|
||||
|
4
third_party/monstaftp/class_monstaftp.php
vendored
4
third_party/monstaftp/class_monstaftp.php
vendored
@ -138,7 +138,7 @@ class Monsta {
|
||||
###############################################
|
||||
private function connectFTP() {
|
||||
|
||||
$this->ftpConnection = @ftp_connect($this->ftpIP, $this->ftpPort, 3);
|
||||
$this->ftpConnection = @ftp_connect($this->ftpIP, $this->ftpPort, 15);
|
||||
|
||||
if ($this->ftpConnection) {
|
||||
|
||||
@ -3014,7 +3014,7 @@ class Monsta {
|
||||
}
|
||||
|
||||
// Check if file reached server
|
||||
if (file_put_contents($fp1,file_get_contents('php://input'))) {
|
||||
if (file_put_contents($fp1, file_get_contents('php://input')) or (int) $ui->escaped('HTTP_X_FILE_SIZE','server') == 0) {
|
||||
|
||||
if (!@ftp_put($this->ftpConnection, $fp2, $fp1, FTP_BINARY)) {
|
||||
if ($this->checkFirstCharTilde($fp2) == 1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user