[SOLVED] Custom Field type "File"?

More
9 years 4 months ago - 9 years 4 months ago #52900 by sg6
Hello,

there is a custom field type, named "File".


Are those files saved anywhere? I can only see the filename in the database, but not the file itself. And the documentation does not say anything about the "File" type.

Thank you for your reply!



Edit: I could solve it by myself, see 3 posts below
Attachments:
Last edit: 9 years 4 months ago by sg6.

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #52902 by sg6
Replied by sg6 on topic Custom Field type "File"?
Ok, via Google I found that thread (couldn't find it via the forum search)

joomdonation.com/forum/events-booking-ge...ad-custom-field.html


So it seems that file upload does not work right now, am I right?

I would like to integrate it by myself, because it is really urgent and I cannot wait. Could you tell me which function in the controller is responsible for storing the data in the database? Because I would integrate the file upload into this function. I only use individual registration and it's always the same custom field, so I guess it won't be much work.

I thought it was the public function process_individual_registration() (line #204 in controller/controller.php), but editing this function does not affect anything for me.

Thank you!

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #53301 by sg6
Replied by sg6 on topic Custom Field type "File"?
*bump* :/

Any help? Advice? Hints?

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #53305 by sg6
Replied by sg6 on topic Custom Field type "File"?
I could finally fix it. I am very disappointed that this feature is not a part of the component, even though it seems like it. Even worse, customers uploaded files which are gone now.

But on the bright side: here's my solution:

Open the controller's function process_individual_registration
/components/com_eventbooking/controller/controller.php line #204
public function process_individual_registration()
20 lines below there is the following line: $model->processIndividualRegistration($post);
I've added the following lines:
Code:
$files = $input->files->get('file-upload'); $model->uploadFiles($files);

The name of my custom field is file-upload, that's why it's $input->files->get('file-upload');

Afterwards go to the register model and add the following function

/components/com_eventbooking/models/register.php line #262
function processGroupRegistration($data)()

Above that line, add the following:
Code:
function uploadFiles() { $uploaddir = './'; // add your custom dir. if you just write ./ it will be uploaded into the model dir $uploadfile = $uploaddir . basename($_FILES['file-upload']['name']); move_uploaded_file($_FILES['file-upload']['tmp_name'], $uploadfile); }

Save it, and the files are uploaded now.

Not the best solution, but at least, it's a solution!

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #53377 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom Field type "File"?
Hi

At the moment, we are dealing with our hosting issue and could not give more information about it. Your solution works, but not the correct one.

We will update the proper code to download package on Monday next week. For the time being, please use the solution you are having

Regards,

Tuan

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #54461 by Rafal
Replied by Rafal on topic [SOLVED] Custom Field type "File"?
Hello,

I am having the same issue. Is there new code published to fix this? I see in a previous post that it was expected around the first Monday of December.

Thanks!
Rafal

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #54472 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic [SOLVED] Custom Field type "File"?
Hi Rafal

We will release new version (1.6.9) this week and will have the fix for it (for the time being, only for individual registration)

Regards,

Tuan

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #54483 by Rafal
Replied by Rafal on topic [SOLVED] Custom Field type "File"?
Thank you Tuan, I just purchased Membership Pro on December 5th so hope I qualify for the individual registration.

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #54501 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic [SOLVED] Custom Field type "File"?
We provide free upgrade for one year for each purchase, don't worry :)

Tuan

Please Log in or Create an account to join the conversation.

More
9 years 3 months ago #55197 by Rafal
Replied by Rafal on topic [SOLVED] Custom Field type "File"?
Hi,
Is the fixed code out yet? Is there a special location where I can download it from?

Rafal

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc