Hello there!
I'm using your fantastic module for osticket and I love it. I have only one problem when I try to upload a PDF file bigger than 2 MB but smaller than 10 MB (I think 10 MB is the maximum size by default). When I click on "Preview" button in the New FAQ or Edit FAQ web page with that file selected for uploading, osFaq gives an error named " was not successfully uploaded".
That message is located on lines 216 ans 225 of /faq/include/FaqUpload.php file, but refers to the second one (line 225) as I could see after testing it, and it is showed because of the if clause that begins in line 141:
if ($value == UPLOAD_ERR_OK) {
xxxxxxxxxxx
} else {
echo ($origfilename . " was not successfully uploaded
");
}
In addition, the complete error message should be -> $origfilename . " was not successfully uploaded 2
"
But it does not show the filename, so maybe the bug is located on something related to that var ($origfilename).
Maybe, the easiest way to fix that is to make possible to upload files manually to /faq/pdf/ directory and then adding that file to an already created FAQ.
I would be pleased if you accept me as developer to help you with this project.
Thanks
Anonymous
Hi,
To fix the error message, in FaqUpload.php try moving line 142 so its above line 141 like this:
$origfilename = $_FILES["file"]["name"][$key];
if ($value == UPLOAD_ERR_OK) {
The size limit issue might be related to your server settings.
Specifically php.ini has 2 parameters "upload_max_filesize" and "post_max_size" which I think could be affecting the size limit for http uploads. phpinfo() will tell you what the parameters are set to; the values are in bytes.
post_max_size is the maximum size for $_POST data and should be equal or larger than upload_max_filesize.
Both values should be in your servers php.ini file.
The solution you suggested would also be a useful addition as it will allow people to link a document to more than one FAQ. A dropdown list with the files in the "pdf" folder would be ideal for this.
I would be happy to add you as a developer for the project but we should go about it in stages. If you have any code you want changed or added to the project, send it to me first so I can have a look. If it looks ok I will add it straight away or release it as a patch. Once we have been through that procedure a few times we can look into making you an official contributor or developer.
At the moment the main aim is for maximum stability, cosmetic bling and bug fixing.
I think Peter and crew (from osTicket) are currently working on a new release of osTicket and from what I can make out it may require some compatibility modifications to osFaq. I'm not positive on that yet but it seems the most likely given some pending changes he has planned for the admin and staff permission systems.
I want to have a new release of osTicket ready within the next 3 months. The main additions will be a captcha system on the userside faq submit page; the rest will be improvements, fixes and cosmetic enhancements.
Feel free to contact me via email [oz-devworx@users.sourceforge.net] to discuss further or get some changes implemented. The time I can spend on the project varies on what work I have on at the time but I always reply when I get the chance.
If I missed anything, let me know.