For uploading the profile pictures you have 2 options.
Store the file your self on disk. This is probably the easiest to implement. Just search for an MVC example on uploading files. The downside of this approach is that it will not be manageable from the members section
The second option is to store the uploaded file in the media section and store the id new media item in the member profile. This is more work, but makes it manageable from the members section using a media picker.
If you search this forum you will find examples for storing a file in the media section
Hmmm, frontender here :( . Im not really into all the custom controller stuff.
Really strange there isn't native support for the upload datatype in the members section.
One would think most member implementations would need at least a profile image.
We decided to not use the uploaded file but rather use blueimp's jquery control and the I believe they have an MVC controller example that would get you further down the road.
I didn't like the upload control because the location was stored as a url and if you move the file In the back end you would get disconnected from it.
Member upload file frontend
I'm trying to enable a member to upload a profile pic on an "Update profile" page, based on the built in partial.
Based on the example loop, where properties are rendered in text boxes
I move on to specific nodes to be able to define specific data types:
But there is no htmlHelper for the upload datatype as far as i can find. So i move on to using input type file, like this:
But this doesnt save anything... Any pointer on how to get this working?
Hi Claus,
can you post the full code of the from and the controller code where you process the submit ?
Dave
Its just a partial
Hi Claus,
It seems a
UmbProfileController
is a built in controller in the core. It probably won't handel uploaded files.The best way is to handle the saving your self with a custom controller. A good starting point is the source code of the built in controller : https://github.com/umbraco/Umbraco-CMS/blob/5397f2c53acbdeb0805e1fe39fda938f571d295a/src/Umbraco.Web/Controllers/UmbProfileController.cs
For uploading the profile pictures you have 2 options.
Store the file your self on disk. This is probably the easiest to implement. Just search for an MVC example on uploading files. The downside of this approach is that it will not be manageable from the members section
The second option is to store the uploaded file in the media section and store the id new media item in the member profile. This is more work, but makes it manageable from the members section using a media picker. If you search this forum you will find examples for storing a file in the media section
Dave
Hmmm, frontender here :( . Im not really into all the custom controller stuff.
Really strange there isn't native support for the upload datatype in the members section. One would think most member implementations would need at least a profile image.
We decided to not use the uploaded file but rather use blueimp's jquery control and the I believe they have an MVC controller example that would get you further down the road.
I didn't like the upload control because the location was stored as a url and if you move the file In the back end you would get disconnected from it.
I ended up with a simple razor upload to a folder, and then parsing the url to a text field property on the member. Does the job in this case.
...
Trying to do something similar here, how did you handle it so that if two members upload files with the same name they don't overwrite eachother?
Hi
I add a guid in front of the filename to make it uniquie
is working on a reply...