mcintyre321 / FormFactory

MVC5, Core or standalone - Generate rich HTML5 forms from your ViewModels, or build them programatically
http://formfactoryaspmvc.azurewebsites.net/
MIT License
304 stars 103 forks source link

How to add FileUpload Object in Programatically created form? #87

Closed fatihcelen closed 4 years ago

fatihcelen commented 4 years ago

Hi i look code but don't see any file upload attribute for input. how can i add file upload object in form.

mcintyre321 commented 4 years ago

You can add either

fatihcelen commented 4 years ago

When I add Property.BlaBla.FileUpload.cshtml in View Folder i get this error.

Severity Code Description Project File Line Suppression State Error NETSDK1022 Duplicate 'EmbeddedResource' items were included. The .NET SDK includes 'EmbeddedResource' items from your project directory by default. You can either remove these items from your project file, or set the 'EnableDefaultEmbeddedResourceItems' property to 'false' if you want to explicitly include them in your project file. For more information, see https://aka.ms/sdkimplicititems. The duplicate items were: 'Views\Shared\FormFactory\Property.BlaBla.FileUpload.cshtml' FormFactory (FormFactory\FormFactory) C:\Program Files\dotnet\sdk\2.1.509\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets 257

fatihcelen commented 4 years ago

Is There any example for file input created with XElement programmatically.

fatihcelen commented 4 years ago

formModel.Add(new PropertyVm(typeof(XElement), "cFoto") { DisplayName = "Document Upload", Value = XElement.Parse("<input type='file' class='form-control' multiple='multiple' value='Upload'></input>") });