publish .pdf of .doc files
-
- Jr. Bludit
- Posts: 2
- Joined: Wed May 23, 2018 9:19 pm
Hi,
I made a bludit site for a small public library. There is a need to share a few .doc and .pdf files.
How can this be managed using the admin web interface ? I tried uploading the file as an image but it does check the extension and only jpg, jpeg, gif and png are allowed and thus cannot be done this way.
Thank you for your help,
Roland
I made a bludit site for a small public library. There is a need to share a few .doc and .pdf files.
How can this be managed using the admin web interface ? I tried uploading the file as an image but it does check the extension and only jpg, jpeg, gif and png are allowed and thus cannot be done this way.
Thank you for your help,
Roland
- Edi
- Site Admin
- Posts: 3121
- Joined: Sun Aug 09, 2015 5:01 pm
- Location: Zurich
- Has thanked: 54 times
- Been thanked: 78 times
- Contact:
The types are set in in the file uploader.php (in the directory /bl-kernel/ajax/).
To allow the uploading of PDF files the array $validExtension can be modified as follows (line 18):
See also Upload von PDF-, Audio- und Video-Dateien.
To allow the uploading of PDF files the array $validExtension can be modified as follows (line 18):
Code: Select all
$validExtension = array('tiff', 'gif', 'png', 'jpg', 'jpeg', 'bmp', 'svg','pdf')
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
-
- Jr. Bludit
- Posts: 2
- Joined: Wed May 23, 2018 9:19 pm
Thank you. I can upload pdf this way. I does need some documentation to link to the pdf as you cannot have the name of the file once uploaded.
I think it will do the job or I will upload the files with an FTP client.
Roland
I think it will do the job or I will upload the files with an FTP client.
Roland
- Edi
- Site Admin
- Posts: 3121
- Joined: Sun Aug 09, 2015 5:01 pm
- Location: Zurich
- Has thanked: 54 times
- Been thanked: 78 times
- Contact:
Yes, there are some restrictions naming files at the moment.RolandBlue wrote: ↑Wed May 30, 2018 10:50 pm I can upload pdf this way. I does need some documentation to link to the pdf as you cannot have the name of the file once uploaded.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Hi all,
I hope you can help me: I want to upload .pdf using the admin web interface, and the suggested solution does not work (Bludit 3.9.2).
In fact, in my upload-images.php, there is no $validExtension array which I can change.
I didn't found it on other places either. Why?
In the directory /bl-kernel/admin/themes/booty/html/ I found this code in the media.php
and in bl-kernel/boot/variables.php there is
If I try to upload a .pdf after adding it there, I get the message
Thank you,
Kao
I hope you can help me: I want to upload .pdf using the admin web interface, and the suggested solution does not work (Bludit 3.9.2).
In fact, in my upload-images.php, there is no $validExtension array which I can change.
I didn't found it on other places either. Why?
In the directory /bl-kernel/admin/themes/booty/html/ I found this code in the media.php
const validImageTypes = ['image/gif', 'image/jpeg', 'image/png', 'image/svg+xml'];
and in bl-kernel/boot/variables.php there is
but it does not work if I add .pdf to either one or both of this codes.// Allowed image extensions
$GLOBALS['ALLOWED_IMG_EXTENSION'] = array('gif', 'png', 'jpg', 'jpeg', 'svg');
If I try to upload a .pdf after adding it there, I get the message
Any ideas what is going wrong and how to fix it?File type is not supported. Allowed types: gif, png, jpg, jpeg, svg, pdf
Thank you,
Kao
You were heading in the right direction as things changed in B 3.9.X
Basically you need to
1. add a valid mime type of the files you want to upload in validImageTypes array
For pdf files add:
Code: Select all
application/pdf
2. add allowed file extension in ALLOWED_IMG_EXTENSION variable, which you have already done judging by the error message
edit, save, upload changes, and let us know if everything works as supposed