Community & Support

Newbie: how to attach files to users

Hello,

I'm trying to reach this functionality:

I have users on my website and they have access to their default profile pages.
As administrator I need to be able to upload unlimited files in 4 categories
and users to see them in their profile pages.

Something like this:
PDF files assigned to my account:
- file1
- file2

.AVI files assigned to my account:
- file1
- file2

etc.

Can you please suggest me a module or combination of modules,
I'm lost a bit...

Thanks

Comments

Create a View that adds a tab

Create a View that adds a tab to the user profile page which lists their file attachments?

e.g.

Create a File content type that has a title, somewhere to upload the file, a reference to the user it should be attached to, a content taxomonomy fiield which links to a taxonomy that lets you indicate the class of file e.g. PDF, AVI etc.

Create a View which has a page with:

  • Filters: Published, Node Type: your file content type
  • Sort criteria: Node: Post date desc
  • Fields: Node title, the file type catagory taxonomy term, date published, etc.
  • Auguments: (the user's UID passed as an agument to be matched against the user reference field)
  • Page settings: Path: user/%/my-files, Menu: Tab: My Files
  • Basic settings: Style: Table

Then on each users profile page they'll see a tab which lists any attached files.
There are probably some subtleties Im missing: Im a little unsure about the user reference field on the File content type and how that would relate to the argument the view uses. I could see how you could do it if you were to simply create instances of the File content type and manually edit the author info to the relevant user's name - then you could just use the User: Uid argument.

Perhaps someone else can offer more insight.

Just took a poke at the

Just took a poke at the appropriately titled User Reference CCK field, while you could mess around with views to create a tab on the user profile it seems there's no need to make things quite so complicated for yourself:

Create a content type for each of the file types e.g. a PDF content type, An AVI content type etc.
Each of these has a title, a description, a place to upload a file whether just the inbuilt upload module or a CCK Filefield, and a User Reference CCK field.

Crucially when you create the User Reference field tick the "Reverse link" checkbox - if a user has any Files attached to them, the title of the File as a link back to that File node will appear on their profile page, catorgorise by the "type" if you create a seperate content type for each file type.

to add another solution - you

to add another solution - you could use content profile, add fields to the content profile and then let the user upload files trough CCK fields - like file field or video.

nobody click here