Regarding my previous comments, we seem to have got to the bottom of the problem.
It appears error reporting was OFF in this new installation, so I was getting no feedback at all with regards to the nature of the problem. Having made the changes to turn error reporting ON, I then got this error:
Warning: move_uploaded_file() [function.move-uploaded-file]: SAFE MODE Restriction in effect.
The script whose uid is 10001 is not allowed to access
/var/www/vhosts/kickasskandy.com/httpdocs/forum/uploads/6
owned by uid 48 in
/var/www/vhosts/kickasskandy.com/httpdocs/forum/library/Framework/Framework.Class.Uploader.php on line 113
To rectify the problem, my server admin had to go in and change the *ownership* of the folder. Here is his response, in case it helps anyone:
It seems that when thta forum software created the folder it doesn't create them as the ftp user, it creates them with ownership by the apache process, so the ftp user isn't allowed to access them
there is probably a long complicated way of rewriting the forum code to create them with the ftp user, but I have gone in via SSH and changed the ownership of those folders to the FTP user.
To do this, (in case it comes up in future) you login via ssh, navigate to that folder (cd /var/www/vhosts/kickasskandy.com/httpdocs/forum/uploads) and then change the ownership (chown [username] [foldername]) and you will be able to upload after that.
alright maybe I have missed the boat here. But I have succesfully installed the exension and can upload a test file to the server and that works fine. But how do I access the file after that? I don't see anything?
I hope I haven't missed something here in the comments or in the Forum. I am facing the following problem:
My Forum is a closed user group, no anonymous posting allowed, registration upon admin confirmation only. Some people in our community are developing software and want to make it available through the forum. However, the content-type tests seem to be annoying at best.
After reading some code I have come to the conclusion, that content-type checking of uploads is a core feature and is enforced as long as extension developers use the offered api functions (I use the Attachment 2.1 with "Multi File Upload" and "Inline Images").
So i went into library/Framework/Framework.Class.Uploader.php and commented out the content-type checking part.
I know that checking content-types and file sizes might in most situations be desired on a public site but not always.
Did I miss some configuration options?
If not, would it be possible to make "turn off" content-type checking available or make it possible to use wildecards in content-types (something like this): $this->AllowedFileTypes = array ( //all javascript files like text/javascript or application/javascript. ending doesn't matter // because it could be named anything anyway '*/javascript' => array('*'), // allow the following text files 'text/* => array('css', 'js', 'txt', 'csv') );
I get the following error message at the top of the page when trying to upload a file that is now allowed:
Notice: Undefined property: DiscussionID in myfilepath/library/Vanilla/Vanilla.Control.DiscussionForm.php on line 124
Anybody have any ideas why that would show up only then? If I upload attachments that are configured correctly in the ATTACHMENTS_ALLOWED_FILETYPES area, everything works great.
Alrighty, hopefully someone's already done this (crossing fingers)...
Has anyone modified this Add-on to work with Amazon Web Services S3 file storage? I'm looking to move from local storage to online storage for my site and before spending the time to take this Add-on and modify it for this purpose, I figured I would ask first and save myself from the agony (if at all possible).
If people aren't familiar with this and want to read more about it, you can point your browser here:
http://developer.amazonwebservices.com/connect/entry.jspa?externalID=847
I have the same problem as #mwbarker in V.1.1.5a:
Notice: Undefined property: DiscussionID "mypath"/library/Vanilla/Vanilla.Control.DiscussionForm.php on line 124
Other thing is that, I have problem when I try to upload attachments larger than 1MB - many times while uploading page Hangs up and file is not uploaded, I must refresh page and upload again.
EDIT: Nevermind, I fixed it. php.ini wasn't doing what it was supposed to.
I am getting the following error messages when trying to upload mp3 files:
The file you attempted to upload (01-Welcome.mp3) was empty.
You are not allowed to upload (01-Welcome.mp3) the requested file type:
Things I have already done:
1. Added the mp3 mime type to the default.php file 2. Fixed the "MineType" typos 3. Increased the size limit for uploads both in the Vanilla extension and in my php.ini file.
I also find it odd that it doesn't give me a MIME type with the error, and that it claims the file was empty.
Like other users, I had a problem with file types not allowed, and I get PHP error messages (like mwbarker and vaniller) when trying to upload files of an unallowed type. Here's a description of the bug and the turnaround I used.
I'm using Vanilla 1.1.5a and Attachments 2.1. I uploaded a few .pdf files sucessfully, but at some point, when trying to upload a new .pdf file, I got the following error message:
Some problems were encountered
The file you attempted to upload (NameOfFile.pdf) was of type "application/download", but the file extension "pdf" did not match the accepted extensions for this type of file: rar, RAR
I got the same with other .pdf files.
When trying again I got the two additional PHP error messages at the top:
Notice: Trying to get property of non-object in myvanillapath/extensions/attachments/default.php on line 703
Notice: Undefined property: stdClass::$DiscussionID in myvanillapath/library/Vanilla/Vanilla.Control.DiscussionForm.php on line 124
I don't know why my pdf files are classified as "application/download". When checking them in Windows, they are perfectly normal pdf files (they start with the %PDF1.3 string). I don't know whether the browser or the server assigns a different type, nor why.
I turned around the problem by allowing files with extension "pdf" to be downloaded as application/download types. For those who need it, here's how to do it: find the following line in extensions/Attachments/default.php:
If you have a problem with another file type, add a line of code for the MIME file type Vanilla mentions in the error message (text/rtf, application/download, etc.); or if there is a line already, add the relevant extension to the list as above.
I installed Attachments-2.1 and have my "Upload Path" (in Attachment Settings) defined as to '/vanillaforum/uploads/Attachments.' When trying to upload a jpg file I get a message "
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed."
Any assistance would be appreciated.
I am having quite a bit of trouble with this plugin. Although it's a good idea and stuff it has quite a few errors. Now I'm no coder or anything and it might just be something that I'm doing wrong. My forum is located here.
One problem I'm having is when I tried to upload a zip folder which was about 9MB onto a discussion that I tried to create it just reloaded the 'Start New Discussion' page and didn't make the discussion or upload the file. I've tried putting the max file upload to 999999 bytes but it still didn't work.
Another issue I'm having with this is when I tried to upload a zip folder yesterday it said:
The file you attempted to upload (malwarebytes.zip) was empty. You are not allowed to upload (malwarebytes.zip) the requested file type:
OK so these are the problems I'm having. I've tried messing about in the default.php file but again, I'm not very good with code so I didn't have a clue to be honest on what I was doing. Anyone have any idea about what's going on? Would appreciate an email to ad7863@googlemail.com explaining what's going on but still would be good if you could just tell me on here. Need to get this fixed asap for a perfect forum
The Extensions works great... Except I also want to be able to host files larger than 64M. I found in the php.ini there was a 64M limit in two places: Post_max_size=64M upload_max_filesize = 64M
I bumped these up to 300M to no benefit. I also upped the Extension setting for max file size to 300M. All I get when I try to up a file larger than 64M is a new Disscusion screen. No errors are ever posted. I did read in the thread where there is an edit to the VannilaDisscusionForm to show the error, but that edit was already in the build.
Attachements 2.1 Vannilla 1.1.5a
Thanks in advance
I edited the wrong php.ini. I needed to edit the php.ini in the c:/xampp/apache/bin, then restart the services in WinXP
I can not attach .tgz's I have added the tgz extension to the list, but I still get an error in regards to get object data and an error on line 703 (original line had 'gz' and 'tar.gz'. I received the error list below so I removed the 'tar.gz' and added 'tgz'. I still received the error listed below.)
Cut-n-paste of error displayed: Notice: Trying to get property of non-object in C:\xampp\htdocs\Vanilla\extensions\Attachments\default.php on line 703 Notice: Undefined property: stdClass::$Context in C:\xampp\htdocs\Vanilla\extensions\Vote\default.php on line 38 Notice: Trying to get property of non-object in C:\xampp\htdocs\Vanilla\extensions\Vote\default.php on line 38 Fatal error: Call to a member function NewContextObject() on a non-object in C:\xampp\htdocs\Vanilla\extensions\Vote\default.php on line 38 from default.php
Cut-n-paste of add extensions from default.php 'application/x-gzip' => array('gz', 'GZ', 'tgz', 'TGZ'), 'application/download' => array('rar', 'RAR', 'zip', 'ZIP')
Cut-n-paste of default.php (starting at line 700) // Save Attachments function DiscussionForm_SaveDiscussionAttachments(&$DiscussionForm) { $Discussion = &$DiscussionForm->DelegateParameters['ResultDiscussion']; $AttachmentManager = &$DiscussionForm->DelegateParameters['AttachmentManager']; $AttachmentManager->DiscussionID = $Discussion->DiscussionID; $AttachmentManager->Comment = &$Discussion->Comment; $AttachmentManager->SaveAttachments(); }
Any ideas why uploading this particular file extension is giving me problems? Would of been nice if I could attach the default.php file in this Forum. :-)
To say I'm noob in html is an understatement.
Im assuming your saying that I could of used the <a> </a> tags to up the default.php?
Has anyone had any luck with attaching .tgz's with this extension?
I just took the .tgz and put it in a zip file and upper that but I would like it to be easier for the end user.
Thanks for the assist!
Sorry, I was obscure, I was referring to the fact that you can effectively "upload" a PHP/HTML file to these forums by simply copying the contents of it and pasting it inside <code></code> tags. Although, yes, you could also link to a file uploaded elsewhere, that's a perfectly valid way to do it too! :) I've not tried TGZ files myself, but if you can upload other files alright, you should be able to add support for the TGZ files by looking at the error message yoyu get when it fails on the TGZs and a little creative copying and pasting in the attachments default.php.
Comments
It appears error reporting was OFF in this new installation, so I was getting no feedback at all with regards to the nature of the problem. Having made the changes to turn error reporting ON, I then got this error:
Warning: move_uploaded_file() [function.move-uploaded-file]: SAFE MODE Restriction in effect. The script whose uid is 10001 is not allowed to access /var/www/vhosts/kickasskandy.com/httpdocs/forum/uploads/6 owned by uid 48 in /var/www/vhosts/kickasskandy.com/httpdocs/forum/library/Framework/Framework.Class.Uploader.php on line 113
To rectify the problem, my server admin had to go in and change the *ownership* of the folder. Here is his response, in case it helps anyone: I hope that helps someone.
Cheers,
Dave
My Forum is a closed user group, no anonymous posting allowed, registration upon admin confirmation only. Some people in our community are developing software and want to make it available through the forum. However, the content-type tests seem to be annoying at best.
After reading some code I have come to the conclusion, that content-type checking of uploads is a core feature and is enforced as long as extension developers use the offered api functions (I use the Attachment 2.1 with "Multi File Upload" and "Inline Images").
So i went into library/Framework/Framework.Class.Uploader.php and commented out the content-type checking part.
I know that checking content-types and file sizes might in most situations be desired on a public site but not always.
Did I miss some configuration options?
If not, would it be possible to make "turn off" content-type checking available or make it possible to use wildecards in content-types (something like this):
$this->AllowedFileTypes = array (
//all javascript files like text/javascript or application/javascript. ending doesn't matter
// because it could be named anything anyway
'*/javascript' => array('*'),
// allow the following text files
'text/* => array('css', 'js', 'txt', 'csv')
);
I am getting the following error messages when trying to upload mp3 files:
The file you attempted to upload (01-Welcome.mp3) was empty. You are not allowed to upload (01-Welcome.mp3) the requested file type:
Things I have already done:
1. Added the mp3 mime type to the default.php file
2. Fixed the "MineType" typos
3. Increased the size limit for uploads both in the Vanilla extension and in my php.ini file.
I also find it odd that it doesn't give me a MIME type with the error, and that it claims the file was empty.
I'm using Vanilla 1.1.5a and Attachments 2.1. I uploaded a few .pdf files sucessfully, but at some point, when trying to upload a new .pdf file, I got the following error message: I got the same with other .pdf files.
When trying again I got the two additional PHP error messages at the top: I don't know why my pdf files are classified as "application/download". When checking them in Windows, they are perfectly normal pdf files (they start with the %PDF1.3 string). I don't know whether the browser or the server assigns a different type, nor why.
I turned around the problem by allowing files with extension "pdf" to be downloaded as application/download types. For those who need it, here's how to do it: find the following line in extensions/Attachments/default.php: Below you'll find lists of allowed extensions for each file type. In my case I changed: into: If you have a problem with another file type, add a line of code for the MIME file type Vanilla mentions in the error message (text/rtf, application/download, etc.); or if there is a line already, add the relevant extension to the list as above.
One problem I'm having is when I tried to upload a zip folder which was about 9MB onto a discussion that I tried to create it just reloaded the 'Start New Discussion' page and didn't make the discussion or upload the file. I've tried putting the max file upload to 999999 bytes but it still didn't work.
Another issue I'm having with this is when I tried to upload a zip folder yesterday it said:
The file you attempted to upload (malwarebytes.zip) was empty.
You are not allowed to upload (malwarebytes.zip) the requested file type:
OK so these are the problems I'm having. I've tried messing about in the default.php file but again, I'm not very good with code so I didn't have a clue to be honest on what I was doing. Anyone have any idea about what's going on? Would appreciate an email to ad7863@googlemail.com explaining what's going on but still would be good if you could just tell me on here. Need to get this fixed asap for a perfect forum
P.S. It's 0.95MB
The Extensions works great... Except I also want to be able to host files larger than 64M.
I found in the php.ini there was a 64M limit in two places:
Post_max_size=64M
upload_max_filesize = 64M
I bumped these up to 300M to no benefit. I also upped the Extension setting for max file size to 300M.
All I get when I try to up a file larger than 64M is a new Disscusion screen. No errors are ever posted. I did read in the thread where there is an edit to the VannilaDisscusionForm to show the error, but that edit was already in the build.
Attachements 2.1
Vannilla 1.1.5a
Thanks in advance
I edited the wrong php.ini.
I needed to edit the php.ini in the c:/xampp/apache/bin, then restart the services in WinXP
Thanks Guys!
GunDeck
I can not attach .tgz's
I have added the tgz extension to the list, but I still get an error in regards to get object data and an error on line 703
(original line had 'gz' and 'tar.gz'. I received the error list below so I removed the 'tar.gz' and added 'tgz'. I still received the error listed below.)
Cut-n-paste of error displayed:
Notice: Trying to get property of non-object in C:\xampp\htdocs\Vanilla\extensions\Attachments\default.php on line 703
Notice: Undefined property: stdClass::$Context in C:\xampp\htdocs\Vanilla\extensions\Vote\default.php on line 38
Notice: Trying to get property of non-object in C:\xampp\htdocs\Vanilla\extensions\Vote\default.php on line 38
Fatal error: Call to a member function NewContextObject() on a non-object in C:\xampp\htdocs\Vanilla\extensions\Vote\default.php on line 38
from default.php
Cut-n-paste of add extensions from default.php
'application/x-gzip' => array('gz', 'GZ', 'tgz', 'TGZ'),
'application/download' => array('rar', 'RAR', 'zip', 'ZIP')
Cut-n-paste of default.php (starting at line 700)
// Save Attachments
function DiscussionForm_SaveDiscussionAttachments(&$DiscussionForm) {
$Discussion = &$DiscussionForm->DelegateParameters['ResultDiscussion'];
$AttachmentManager = &$DiscussionForm->DelegateParameters['AttachmentManager'];
$AttachmentManager->DiscussionID = $Discussion->DiscussionID;
$AttachmentManager->Comment = &$Discussion->Comment;
$AttachmentManager->SaveAttachments();
}
Any ideas why uploading this particular file extension is giving me problems?
Would of been nice if I could attach the default.php file in this Forum.
:-)