Hello, i am following this tutorial:
http://www.chronoengine.com/faqs/53-cfv4/cfv4-file-uploads/2630-how-can-i-upload-files-under-some-users-folder.html
and this thread:
http://www.chronoengine.com/forums/posts/t90947/p315781.html
but i can't make it work no matter what i do :?
First of all i use Joomla 3 & ChronoForms V5, dont know if this code is working on it.
In Designer Tab
1 File Field (Field Name= file01, Field ID=file1)
In Setup Tab
1 Custom Code field with this code:
1 Files Upload (Files config=file01:jpg-png-gif, Upload path=images/file1)
Dont know if the images/file1 path is correct but thats where i want the users folder to be created and the files uploaded.
Anyone that can see what i am doing wrong?
http://www.chronoengine.com/faqs/53-cfv4/cfv4-file-uploads/2630-how-can-i-upload-files-under-some-users-folder.html
and this thread:
http://www.chronoengine.com/forums/posts/t90947/p315781.html
but i can't make it work no matter what i do :?
First of all i use Joomla 3 & ChronoForms V5, dont know if this code is working on it.
In Designer Tab
1 File Field (Field Name= file01, Field ID=file1)
In Setup Tab
1 Custom Code field with this code:
<?php
$user =& JFactory::getUser();
$form->set('upload_files_file1', 'upload_path', JOOMLA_PATH."/images/uploads/{$user->username}/");
?>
1 Files Upload (Files config=file01:jpg-png-gif, Upload path=images/file1)
Dont know if the images/file1 path is correct but thats where i want the users folder to be created and the files uploaded.
Anyone that can see what i am doing wrong?
Hi Gatsman,
I have just added new section to the FAQ page with the code needed for v5 because its slightly different.
Regards,
Max
I have just added new section to the FAQ page with the code needed for v5 because its slightly different.
Regards,
Max
Thank you for updating the FAQ Max, but i still can't make it work π’
It uploads the file but not where i want it, its either the default folder or whatever it put into the Files Upload - Edit action settings
This is the code in Custome Code before the Files Upload
I could try and backup & upload my simple file upload form in case you want to take a look at it.
Thanks again
It uploads the file but not where i want it, its either the default folder or whatever it put into the Files Upload - Edit action settings
This is the code in Custome Code before the Files Upload
<?php
$user =& JFactory::getUser();
$form->actions_config[file1]["upload_path"] = "images/uploadfiles/".DS.$user->get('username').DS;
?>
I could try and backup & upload my simple file upload form in case you want to take a look at it.
Thanks again
"file1" is not a valid action id, the action id in v5 is written beside the action's name, with a sky blue background, and its a numeric value.
Moreover, the path in your code is incomplete, try to add JPAH_BASE to the start of the string!
Regards,
Max
Moreover, the path in your code is incomplete, try to add JPAH_BASE to the start of the string!
Regards,
Max
Still can't make it work
Thanks for the id info didn't know that, its [1] for me.
The correct path must be
Thanks for the id info didn't know that, its [1] for me.
The correct path must be
$form->actions_config[1]["path"] = JPATH_BASE.DS."images/uploadfiles".DS.$user->get('username').DS;
Thats upload_path in my previous post
$form->actions_config[1]["upload_path"] = JPATH_BASE.DS."images/uploadfiles".DS.$user->get('username').DS;
But why did you change it to "path" ? it should be "upload_path"!!π
And that still doesn't work ? please add a debugger action after the "files upload", also do you have the "custom code" before the "files upload" ?
I 've gone crazy trying everythingπ i saw it in the debugger
and i thought i give it a try.
I always had a debugger on submit here are the PrtScr
[path] => images\upload_files\20140515092804_G_background.png
and i thought i give it a try.
I always had a debugger on submit here are the PrtScr
Your files upload id is "0" but not "1" as you have in the code!π
This topic is locked and no more replies can be posted.