e107help.org Q&A
0 like 0 dislike
After setting the php.ini to 300M on both max file size and post size, I wanted to add more file type to the filetype.xml file and using this format:-

<class name="253" type="zip,gz,jpg,jpeg,png,gif,bmp,pdf" maxupload="3M" />

<class name="254" type="iar" maxupload="10M" />

<class name="255" type="oar" maxupload="300M" />

So that the 2 extra file type have separate upload limits, but it seems I can only use classes 253 and 254, when I try to use any other class number the addition doesn't show up in the 'File Uploading' section of preferences.

How do I add more file types without combining then all on one line?
e107 version 2.0 bootstrap other than that, there is no version information anywhere within e107.
in Core by (8 points) 1 6

2 Answers

0 like 0 dislike

There are classes in use example you typed 254 = having admin rights ;  255 = nobody  ....

here's a small list that might help (except main)

PUBLIC', 0
READONLY', 251
GUEST', 252
MEMBER', 253
ADMIN', 254
NOBODY', 255

So if using 252 it means only guests may upload, but maybe that is against the system setting that they are not allowed... think very carefully about security and possibility.

Adding a new class (if possible) , you will need to talk to the developers.

by (3.2k points) 7 9 11

Thanks, that worked, but using the same class number in the filetype.xml file, like this:-

 

<e107Filetypes>
        <class name="253" type="rar,gzip,zip,gz,jpg,jpeg,png,gif,bmp,pdf" maxupload="3M" />
        <class name="253" type="iar" maxupload="20M" />
        <class name="253" type="oar" maxupload="500M" />
</e107Filetypes>

 

When I created this question, I was following directions on the github:-

https://github.com/e107inc/e107/wiki/Public_Uploads

Which showed the use of class numbers and without any explanation of their meanings, I assumed the numbers were a type of category, but it also said to not use duplicate classes, which also confused the situation, but now I have it clear, I used the same class (253) for multiple filetypes with differing upload size restrictions, which works perfectly now.

Looking at the date on that github page, I noticed it's 2017, it might be a good idea to update it for E107 V2 bootstrap.

This ticket can now be considered fix and closed.

Thanks for the help.

Glad it worked for you.

Just another idea comes in mind, although i never tested it, and it wiill work ???? YOur still busying around..worth an effort... (should yjay work yoo, please use the textual agrreements section to warn yes or no(t) possible...

Since you are using the 'members' class, you also could consider using (types of extensions are uncommon);
to a certain member class-name which in itself also divides the 'standard user/member' ( in meaning only certain members may upload these > seperate member class)
0 like 0 dislike

Just from curiosity - you are using the same class for all types, why you don't use preferences for this:

by (1.9k points) 15 46 56
I wanted to use different classes to allow certain people to upload, IE, for guests I wouldn't allow any, but members I would allow only a certain types of upload and allow various upload sizes depending on what's being uploaded.

EG

Members can upload image files in jpg, jpeg, png, bmp, and gif limited to 2MB, but they can also upload 2 other types of files and they are the files that belong to a virtual worlds simulator data save and they are iar and oar, the iar can be as big as 50MB, but oar files have been known to reach as large as 300MB, so by placing a limit of 500MB on that particular file type then those files can be uploaded as long as they don't exceed those sizes, hence I use the one class in the filetypes.xml file to restrict the sizes that members are allowed to upload.

Just adding in correlation to all above.

I added the class line for members 253 to use iar files. (max 20Mb)

Since i have certain uploadlimit , i can not test  300 Mb oar, so iar has to do.... (i used your code) and uploaded a 19Mb iar file.
info : for dowloadpurpose you have to import it by ftp (system lets use it internal but dies NOT allow the upload through media manager (import needs run afterwards) in the normal basic user line,
else uploadlimits-size comes in danger; so the extra line is best. (FTP is certainly the quickest and maybe hacking the mime filters; but needs to ask the developers
( i would not do it, only ftp) since core file hacking is when updating....gone..

Anyway

As being 253 = member it does not need much effort to do what you want
The class line adds ONLY type and size, correct?
Normally any member should see it without any change...

NOw make it yourself easy : create a new user class.
Maybe can call it IAR_use / and /or OAR_user etc...
Now when creating the download itself point to THAT userclass (IAR/OAR). Save.
You (sorry it it is a lot of work) go to members part > USER (name) and ADD him/here ALSO to the IAR/OAR class...
You can choose iff ALL members are allowed to see them, (during creation of download settings) but as long as they are not a member of the iar/oar they will get a deny message...
If setting is visible for the iar/oar class only, the standard member will not see it (Not even if it it inside the same category running...)

Tested it that way, and no troubles at all

Welcome to e107 Q&A, where you can ask questions and receive answers from other members of the e107 community.
924 questions
1,326 answers
2,309 comments
2,297 users