diff --git a/build/index.php b/build/index.php index 34b67e6..d92a73f 100755 --- a/build/index.php +++ b/build/index.php @@ -2941,6 +2941,9 @@ register_module([ $filepath = $env->storage_prefix . $pageindex->{$env->page}->uploadedfilepath; $mime_type = $pageindex->{$env->page}->uploadedfilemime; + $shortFilename = substr($filepath, 1 + (strrpos($filepath, '/') !== false ? strrpos($filepath, '/') : -1)); + + header("content-disposition: inline; filename=\"$shortFilename\""); // If the size is set or original, then send (or redirect to) the original image // Also do the same for SVGs if svg rendering is disabled. diff --git a/module_index.json b/module_index.json index 6408740..a2b3cc5 100755 --- a/module_index.json +++ b/module_index.json @@ -77,7 +77,7 @@ "author": "Starbeamrainbowlabs", "description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File\/' prefix.", "id": "feature-upload", - "lastupdate": 1472230366, + "lastupdate": 1473613885, "optional": false }, { diff --git a/modules/feature-upload.php b/modules/feature-upload.php index 199308c..b97bc3e 100644 --- a/modules/feature-upload.php +++ b/modules/feature-upload.php @@ -245,6 +245,9 @@ register_module([ $filepath = $env->storage_prefix . $pageindex->{$env->page}->uploadedfilepath; $mime_type = $pageindex->{$env->page}->uploadedfilemime; + $shortFilename = substr($filepath, 1 + (strrpos($filepath, '/') !== false ? strrpos($filepath, '/') : -1)); + + header("content-disposition: inline; filename=\"$shortFilename\""); // If the size is set or original, then send (or redirect to) the original image // Also do the same for SVGs if svg rendering is disabled.