• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Error when uploading attachment in RM: "The uploaded file does not have an allowed extension"

SchmitzIT

Well-known member
#1
Ohai!

So when attempting to attach a pdf file to a resource, I get an "The uploaded file does not have an allowed extension" error. However, pdf is definitely in my allowed resource file extensions list:

1518216142035.png

It's also allowed in regular attachments:

1518216168005.png

Yet, here it is:

1518216187803.png

It's definitely not the upload size. I configured for 200mb in my PHP.ini, and Xenforo happily accepts that:

1518216231480.png

The file in question is 2MB or so.

Any ideas?

Thanks in advance.
 

SchmitzIT

Well-known member
#2
Strangely enough, I have the same issue with zip files. If I add them as the actual Resource file in the initial creation of the resource, it goes fine. When I later on edit the Resource, and then attempt to add a zip file, I get the exact same error about allowed extensions.

Send an old priest and a young priest, please.
 

Slavik

XenForo moderator
Staff member
#3
Can you reproduce this repeatedly? I have run into this a couple of times but never on a consistently repeatable basis so havent been able to verify/debug the issue.

Can you send in a ticket with access information if so please!

Thanks
 

SchmitzIT

Well-known member
#4
So far, yes, I have been able to reproduce it repeatedly. I have not yet managed to upload either a PDF or zip file as an attachment. Will open up a ticket now :)
 

Kevin

Well-known member
#5
I'm running into the same thing XFRM 2.0.1 with XF 2.0.2 -- it allows me to add a zip file when creating the resource as the resource file but if I edit an existing resource and try to attach a zip file there I get the error message.

Looking at /src/addons/XFRM/Attachment/ResourceUpdate.php it looks like it might hard-coded to only allow images to be attached to a resource in getConstraints? :unsure:
 

SchmitzIT

Well-known member
#7
I "solved" the issue by editing the php file. Not sure that's the best solution in my case. Possible options:

* Manual edit (which will be overwritten when updating RM)
* Attach the files to the resource itself (add them to the ZIP; not a fan of this one)
* Use a custom field, use CSS to create it into a button, and stuff the PDF or zip behind that (not a bad option if that suits your specific needs)
* Create a small add-on that does the file edit
* Buy a few bottles of Southern Comfort and bribe @Kier into making it an option customizable from the admincp, similar to other attachments.