Forums / Cotonti / Development / Question about extra fields "file"

tensh
#1 2012-08-25 11:09

Hi;

I have one questions about extra field (the file field) for users:

- how can limit the upload to only one (or some) type of file?

This post was edited by tensh (2012-08-25 11:23, 11 years ago)
Dave
#2 2012-08-25 11:49

im not sure but for the Genoa there is a php file called extensions.php in the "datas" folder

and i think ull be allowed to limit only size of the Personal File Space.

-Dave

Your advertisement here :-)

Cotonti Genoa based site: forgotten-garage.pl
tensh
#3 2012-08-25 11:57

thanks for an answer, however it seems not to work since I was able to upload a php file. Sure it can't be executed due to htaccess settings, but it still makes me feel ueasy about it :)

Added 7 days later:

Can ANYBODY help me with this issue?

This post was edited by tensh (2012-09-01 08:34, 11 years ago)
Trustmaster
#4 2012-09-02 19:15

I think there isn't any type filter for file extrafields currently. You have 2 options:

  • Make an issue for 0.9.12 so it gets fixed there (in a few weeks).
  • Try to implement some plugin that would check extension of $_FILES['inputname']['name'] on form submit (i.e. page.add.add.first and page.edit.update.first) and throw an error (via cot_error()) if it is bad.
May the Source be with you!
tensh
#5 2012-12-06 09:34

When I find my login info, I'll add an issue :) It would be great if it checked the extensions. Better be safe than sorry.