Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By hprashi on
hi,
I want users to be able to upload their resume when they register. I downloaded the profile module.. using which i was able to add additional fields when member is registering... but the upload file option is not there...
Can anyone please tell how to do this?
Comments
That's because there isn't one!
Hi,
I am trying to do the same thing! There is no file upload field for the profiles. I was looking into the taxonomy_fields module where you can attach different field types to content types, but don't think it will work here as profile isn't listed as a content type.
Another reply to a similar post (the only one I could find) says (http://drupal.org/node/59792) you can achieve it using the Content Construction Kit and Node Profile module (http://drupal.org/project/nodeprofile). I am looking into this at the moment. This module allows you to build profiles out of nodes, so you can put a file upload field in. I looked at the demo though and it looked a bit disjointed with the my account page.
Will report back on any success, in the mean time if anyone else has any ideas or who has done this before that would be most welcome!
http://www.open4.org/bio/steve-purkiss - view my online profile
http://www.open4.org/site_tour/quick_tour - free blogs and clubs with 100% AdSense revenue going to you!
Usernode, Nodeprofile
Hi
there is a solution for your problem, use usernode and nodeprofile or the bio.module. You have to make contenttypes out of your userprofiles. There are some examples around how to make it.
Dirk
Thanks but how do I get it in the register form?
Thanks Dirk, very helpful!
I installed the usernode profile and see it's fairly similar to the bio module except more generic.
My particular problem is that I want to show this field in the user registration form which I don't think the above solutions will help with. So I'm back to playing with user profile to see if that will do the job, unless I'm missing something obvious...
http://www.open4.org/bio/steve-purkiss - view my online profile
http://www.open4.org/site_tour/quick_tour - free blogs and clubs with 100% AdSense revenue going to you!
What you want to do...
hi open4.org
so maybe i missed something. What you want to do exactly? A user will register, than after entering name, email, password you want him todo what? Attaching a file? right!
Ok lets start from a scratch i would override the normal user.profile by usernode or bio. Than use pageroute and node family to make a easy way through the different steps he should do. Using an node type as profile makes it easy to attach a file, with node profile and node family you can even limit the may population to one etc.... And you can search all your user profiles via the core search witout any extra modules.
I know it sound a bit confusing but it works. www.freelens.ws/dirksway a testing site for a comunity.
Dirk
Think I'm getting there...
Kind of like that! It's for a jobs community site, so when people register I have added extra fields in the user profile which they can fill out when register (the pageroute module will be a great help here thanks!). The only field I have left is for the CV upload.
I'm currently half-following this tutorial:
http://shellmultimedia.com/tutorials/user-profiles
So I've created a new content type for user profile called uprofile, selected use as user profile node, and am just about to add a file field to it.
Getting there...
http://www.open4.org/bio/steve-purkiss - view my online profile
http://www.open4.org/site_tour/quick_tour - free blogs and clubs with 100% AdSense revenue going to you!
not using jobs/resume module
...and before you say "there's a jobs/resume" module - I know, but it doesn't do what I want (i.e. integrate into reg form) and has more than I need! I just need something that emails the site admin when a CV is uploaded as it has to be entered onto a third party system.
http://www.open4.org/bio/steve-purkiss - view my online profile
http://www.open4.org/site_tour/quick_tour - free blogs and clubs with 100% AdSense revenue going to you!
Woo - it works!
Thanks for all who pointed, I got it working in the end!
I used nodeprofile (which needs nodefamily and subform_element) and bits from this tutorial http://shellmultimedia.com/tutorials/user-profiles to create an extra field in the profile of file type which shows up in the registration form.
Feeling better now I know a little more about drupal than I did this morning, however glad I don't have to learn that one again ;)
http://www.open4.org/bio/steve-purkiss - view my online profile
http://www.open4.org/site_tour/quick_tour - free blogs and clubs with 100% AdSense revenue going to you!
God for drupal
Hi open4.org,
good that you found your way. Did you saw my aproach at freelens? Different one but it works.
Cheers and success
Dirk
hey open4 can u please tell
hey open4 can u please tell me the steps followed to achieve it....
i couldnt follow :(
Step-by-step how to add a file upload field to user registration
DesignWork - I couldn't see how you did it on freelens. Couldn't see a register button, and /user/register didn't show up much - have you a link? I think your way may allow using pageroute, but I'm going to try it on the way I've done it first and if not work then I'll try your way!
hprashi - sure. I've just downloaded a fresh test install of drupal just to make sure I get it right ;)
Step-by-step how to add a file upload field to user registrationDownload and install the following modules (all for drupal 5)
Create a new content type for the file upload field. Most of this is taken from the tutorial at http://shellmultimedia.com/tutorials/user-profiles but specialised for this tutorial
Add the file field to the new content type
Integrate into registration process
Grant access privileges
Try it out!
Please do post and let us know if it worked for you OK!
http://www.open4.org/bio/steve-purkiss - view my online profile
http://www.open4.org/site_tour/quick_tour - free blogs and clubs with 100% AdSense revenue going to you!
thanks a lot! .... till day
thanks a lot! ....
till day i had heard about how open communities work.... now i am witnessing it....
hats off!
Thanks
Thanks i needed something like this will implement it
Create content menu?
Hi, tried this out and it works great. I had one question, when I allow access to create the new node (called faculty_profile) the menu "Create content" appears. I'd like to hide this menu and only use the user screen to edit this. Is it possible to allow permission to create a new node without the "Create content" menu appearing?
Thanks for the great tutorial,
Eric
---
Nevermind, sorry I knew I'd figure it out once I posted. I realized that you just need to "disable" the menu item under Administer -> Menus. Then it hides the "Create Content" menu. This has helped me alot to allow faculty to upload their cv, thanks again.
Problem after following tutorial
Hi,
Thanks for the tutorial, it's exactly what I was looking for. The only problem is that when I upload a cv I get the following message
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM content_ WHERE vid = 0 LIMIT 0, 1' at line 1 query: SELECT FROM content_ WHERE vid = 0 LIMIT 0, 1 in /home/papsonli/public_html/includes/database.mysql.inc on line 172.
Any ideas what this could be?
Thanks,
Vasco
solved
I had messed up the permissions
Which permission was not right?
Hi vascopedro
I'm seeing the same error but can't seem to get rid of it.
The settings under node module (checked for authenticated user) are:
create resume content
edit own resume content
edit resume content
NOTE: I've named the new content type as per the solution above as "resume".
Unfortunately, this still doesn't work. Any suggestions since you said it was a permission problem?
Link to CV leads to user profile page and not file
Hi,
I guees the current bug is that when you look at the link to the profile, you actually get taken back to the user page. You can never download the CV.
What did I do wrong?
Thanks,
Vasco
Using custom profile and this method...
I am able to use this method with success. However, I'd like to create a custom profile with not only my regular fields showing up but also the file attachment. Also, I can't get the resume to show up at the bottom of the page, even using the weight at 10.
any ideas?
Thanks!
Timech
Any other fields with wieght 10?
timech187,
Were you able to resolve this?
If not, do you have any other fields in this CCK content type with weight 10?
Is there any way to improve
Is there any way to improve the security of this? I don't want people other than people in a certain usergroup to be able to access the file, either by viewing it from the profile or typing a link to the file directly into the browser.
Webmaster @ WikiJob Graduate Jobs
Installation of Filefield
How do you install this module? I do it like my normal modules, but it doesn't show up to pick it in the Administrate > Modules. I'm kind of new...anyone that can give me a brief instruction on what to do? I notice that the unzipped folder has only one file with no extension.
Just not sure where to go from here....
Thanks!
Why don't you use hook_form_alter
It can be easily done through hook_form_alter
function hook_form_alter($form_id, &$form) {
if ($form_id == 'user_register') {
$form['#attributes']['enctype'] = 'multipart/form-data';
$form['file'] = array(
'#type' => 'file',
'#title' => t('Title'),
'#size' => 40,
'#default_value' => '',
'#weight' => 6
);
}
}
And in hook_user
do following coding
case 'insert' :
$file = file_check_upload('file');
if ($file){
$file = file_save_upload($file,$filename);
db_query(");
...............
}
sorry: how do you do this in
sorry: how do you do this in drupal 6 ?
For drupal 6
You have to write same code using drupal 6 API. e.g. $form_state is used in hook_form_alter() function.
Hook_form_alter works but need help on hook_user
Thanks for the code, I now have the upload box on the correct form, but I'm unsure what to do with the code for hook_user, I took a stab at it, but it just makes the site load with a blank page.
function profileplus_user() {
case 'insert' :
$file = file_check_upload('file');
if ($file){
$file = file_save_upload($file,$filename);
db_query(");
}
I suppose you could have a
I suppose you could have a look at the original user picture file upload validator?
To do this, I suppose U
To do this, I suppose U should use the hook_form_alter() to modify a profile field "File" (of type textfield) into the proper file-upload field.
Once this is modified, the form gets rendered, and the textfield should be rendered as a file-upload box.
You should also add a new validator function to the user_register_form with $form['#validate'][] = 'MODULE_user_register_validate';
In this function, which receives both $form, and $form_state, as a normal form validate function, you can validate the uploaded file, save it in the DB if valid, and take only the relative file path.
Put this filepath into the $form['file']['#value'] and change it's type back to textfield.
Once everything is validated, the submit function should fire, containing hooks to the profile save api function, which should save the relative path into the DB...
I suppose you could then render this URL back into its download URL using file_create_url ?
Cool
Thanks everyone... :)