X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=js_upload%2Fjs_upload.php;h=148fde313a43557d9b2068aa773c029127731590;hb=30ee2ab542723c0bf4ac40d13a91300590145dfb;hp=c529be36602de6f0821a8e443ac369288dc63f4e;hpb=f8c9d26dd3ba5fbb3ce75efc30070d2edfeab556;p=friendica-addons.git diff --git a/js_upload/js_upload.php b/js_upload/js_upload.php old mode 100644 new mode 100755 index c529be36..148fde31 --- a/js_upload/js_upload.php +++ b/js_upload/js_upload.php @@ -45,6 +45,8 @@ function js_upload_form(&$a,&$b) { $cancel = t('Cancel'); $failed = t('Failed'); + $maximagesize = intval(get_config('system','maximagesize')); + $b['addon_text'] .= <<< EOT
@@ -91,6 +93,7 @@ function createUploader() { '', debug: true, + sizeLimit: $maximagesize, onSubmit: function(id,filename) { if (typeof acl!="undefined"){ uploader.setParams( { @@ -193,7 +196,13 @@ class qqUploadedFileXhr { */ function save() { $input = fopen("php://input", "r"); - $this->pathnm = tempnam(sys_get_temp_dir(),'frn'); + + $upload_dir = get_config('system','tempdir'); + if(! $upload_dir) + $upload_dir = sys_get_temp_dir(); + + $this->pathnm = tempnam($upload_dir,'frn'); + $temp = fopen($this->pathnm,"w"); $realSize = stream_copy_to_stream($input, $temp);