November Happy Hour will be moved to Thursday December 5th.

Upload file by user

Vote:
 

I would like to upload file from user form. When I search for the solution, I found that EpiServer.Forms support file upload but we are not using Forms for the pages and created programmatically.

For example, we are creating a page element using the following code

[Editable(true)]
[Display(
Name = "Name",
GroupName = SystemTabNames.Content,
Order = 10)]
public virtual string userName { get; set; }

Is there any way to upload file from user forms?

Also, Geta.Epi.MediaReferenceSelector can be used with following UI hints

[UIHint("ResponsiveMedia")]
[UIHint("ivpropertymedia",PresentationLayer.Edit)]

What is the variable type to use for MediaReferenceSelector?

#200326
Edited, Jan 09, 2019 7:28
Vote:
 

If you are not using EPiServer Forms, you have to handle upload file yourself. By creating page controller (see Alloy MVC), you can all request information including files which are uploading. In there, you save your file and update property as you want.

#200532
Jan 15, 2019 8:06
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.