Hi,
I'm trying to integrate submission of data to user-specific table in database.
meaning, every user will have the same form that will write the data to a different table in database. So I can see in the database all data from the same user in one table.
Next step, is to create file-upload field which is user-specific too, meaning each user will have a directory where all his uploaded files are.
Any chance to do that in chrono?
Hi yigal,
Both of these are possible, I'll need to look a little at the file upload.
Having a different table for each user doesn't sound like a good idea - it can get difficult to manage. Better to put all the data in the same table and use a user_id column to identify who it belongs to.
Bob
Sorry bob,
I'm no programmer,
could you just let me know how to insert the user-id info into a column in that table? I guess it's just a piece of code I should put somewhere.
$filename = JFactory::getUser()->username . DS . date('YmdHis').'_'.\$chronofile['name'];
I really don't understand how this code did the trick. it returns only the current logged in username and the date for me when I placed in onsubmit code-after email. I think I'm doing something wrong and there are missing parts of the puzzle and I stuck. the code I need should create a folder named by current user and save the user's uploaded file into this folder. I'm not a coder and I guess it is not that hard to do for a pro.
Hi firestarter,
That code will only work in the ChronoForms File Uploads tab. If you are using some other file uploader than it will do nothing for you.
Bob
Hi Firestarter,
As Bob mentioned, the code needs to go in "FileName Format" setting in the File Upload tab, and not in the onsubmit.
Yigal
it worked like a charm in the end. the mistake was mine. I forgot to add 'enctype="multipart/form-data"' to form tag attachment textbox. thanks for your support.