solved can't upload several file formats

alt=
@dobmat
10 years ago
93 posts
Hi

In a form I've a button to upload files. I have selected the type of field as file. But I cannot upload many file formats such as doc, rtf etc. It says this format is not supported but doesn't say which types can be uploaded. Please help how I can configure this.

Also I want to purchase file downloads module. But I'm not sure as I'm not able to upload several formats, I think download module is not much useful if files cannot be uploaded in the first place.

Thanks.
updated by @dobmat: 08/11/14 06:20:33PM
paul
@paul
10 years ago
4,331 posts
In the jrFile module you can define the allowed file types (txt, doc, pdf etc.) per quota.
In the custom form field that you have defined as a 'file' type, you can similarly define the allowed file types in the the custom field options section.
hth
Pa


--
Paul Asher - JR Developer and System Import Specialist
alt=
@dobmat
10 years ago
93 posts
I didn't understand it clearly. Do you mean that I need to have jrFile module to have other file types to be allowed for upload. The form is from a custom module that I created. can I use the file types defined in jrFile module in my custom module.

Or do you mean that I can define file types to be uploaded in my custom module form without needing the jrFile module. In this case can you please provide an example. like is there any other fields that can be used to define file types like I can define the type of field as 'type' => 'file',. is there any option like this?

Thanks.
paul
@paul
10 years ago
4,331 posts
Sorry for being unclear. I was answering both your initial questions at the same time which is confusing!!

Quote: In a form I've a button to upload files. I have selected the type of field as file. But I cannot upload many file formats such as doc, rtf etc. It says this format is not supported but doesn't say which types can be uploaded. Please help how I can configure this.
In the custom form field that you have defined as a 'file' type, you can similarly define the allowed file types in the the custom field options section.

Quote: Also I want to purchase file downloads module. But I'm not sure as I'm not able to upload several formats, I think download module is not much useful if files cannot be uploaded in the first place.
In the jrFile module you can define the allowed file types (txt, doc, pdf etc.) per quota.

You don't need the jrFile module in order to add custom file fields to forms.
hth


--
Paul Asher - JR Developer and System Import Specialist
alt=
@dobmat
10 years ago
93 posts
Hi

How do I define the allowed file types. I tried this and it still gives same error.

$_tmp = array(
'name' => 'artists_docs',
'label' => 'artist docs',
'help' => 'upload documents for artist',
'text' => 'upload documents',
'type' => 'file',
'options' => 'txt,pdf,doc,xls',
'multiple' => true,
'required' => false
);
jrCore_form_field_create($_tmp);

Thanks.
MAD
MAD
@madc
10 years ago
600 posts
You need to access your module via the ACP I think here.
You are trying to edit the code it looks like.

Go into the module in the ACP on your website and set its upload permissions eg. what file....pdf,jpg,gif,mp3,zip etc


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion
brian
@brian
10 years ago
10,148 posts
You need to use "extensions" - not "options" if you are defining them inside a module (not form designer) - i.e.

'extensions' => 'doc,html,htm,jpeg,jpg,pdf,png,ps,rtf,tif,txt,xls,zip',

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
@dobmat
10 years ago
93 posts
Thanks that worked.

Tags