File upload 'Restricting mimetypes' Problem

A place for users and developers of the Xataface to discuss and receive support.

Postby geller » Wed Oct 04, 2006 3:25 pm

I am getting the following error when I try to restrict file types:-

The file submitted in field 'image' is not the correct type. Received 'image/gif' but require one of (image/gif,image/jpeg).

Here is a snippet from the fields.ini

[image]
Type = container
widget:type = file
allowed_mimetypes = image/gif,image/jpeg

If I remove restrictions all works fine. I also get the same problem if I try to restrict by extension.

Is it just me or am I missing something....

Also is there a way to restrict file size?

Cheers
Graham
geller
 
Posts: 26
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Wed Oct 04, 2006 3:57 pm

Thanks for pointing out this issue. This was caused when dataface switched back to parse_ini_file() as a means of parsing the ini files (instead of PEAR_Config) - so it stopped loading comma-delimited values into arrays.. I have uploaded a patched version of Table.php that will correct this issue here
http://framework.weblite.ca/development/issue-tracker/130

I have also added a max_size restriction in this version.

Simply add:


max_size = 1024

to the fields.ini file section for the field. The above example would limit the upload size to 1024 bytes (i.e. 1 kb).

Hope this helps.

Best regards

Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby geller » Fri Oct 06, 2006 10:57 am

Hi Steve

I have tried the patch but unfortunately it doesn't appear to work I am still getting the same problem.

Cheers
Graham
geller
 
Posts: 26
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Fri Oct 06, 2006 11:31 am

That is interesting... just tried it out again here, and it appears to obtain the desired results.
What version of dataface are you running? If you are running anything older than 0.6.9, try updating to the latest, then applying the patch again.

Best regards

Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 5 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved