
Upload
Upload the file by clicking
If you edit too much content, signalR
communication interruption may be triggered. Please adjust the HubOptions
configuration.
builder.Services.Configure<HubOptions>(option => option.MaximumReceiveMessageSize = null);
The InputUpload
component is used with other form components to display the file name, select the file and upload it by clicking the browse button, and by setting the ShowRemoveButton
parameter, display the delete button, click the delete button to call back onDelete
delegate method
Demo
Use the file upload component to constrain the file format within the form
Demo
- Using the
ValidateForm
form component, custom validation is set by setting thefileValidation
label of the model properties to support file extensionsizevalidation, in this case with the extension.png .jpg .jpeg
and the file size limit to50K
- After selecting the file and not starting to upload the file, click the
submit
button to verify that the data is legitimate, and then upload the fileOnSubmit
callback delegate, noting that the Pictureproperty type isIBrowserFile
The ButtonUpload
components, classic styles, user click button to pop up the file selection box.
Demo
Click on the browse button
select file upload, in this case set IsMultiple-true
multiple-selectable file can be uploaded
When you set up IsSingle
, you can upload only one image or file
Set ShowUploadList
value to false as normal button
Use DefaultFileList
to set up uploaded content
Demo
Use DefaultFileList
to set up uploaded content
Demo
AvatarUpload
component, using the OnChange
to limit the format and size of images uploaded by users. In this example, only jpg/png/bmp/jpeg/gif
five picture formats are allowed
Demo
Card form avatar box
Round avatar frame
Set the preview address PrevUrl
with the DefaultFileList
property

Verify that an example of using a picture box is used in the form
CardUpload
components and rendered in card-style band preview mode
Demo
Server Side
mode, you can use the IWebHostEnvironment
injection service to get to the wwwroot
directory and save the file to the images/uploader
, which does not require a direct call the controller secondary of MVCSaveToFile
methodwasm
mode, IWebHostEnvironment
needed to save files to the server side by calling webapi
interface, and so onUpload
components through the wiki
in the open source repository related resources of the [The portal]200MB
In this example, the ShowProgress=true
display upload progress bar
When you set up IsSingle
, you can upload only one image or file
Icons are displayed in different file formats
Demo
By setting the IconTemplate
parameter and using the FileIcon
component, you can further customize the file icon [FileIcon example]
Demo
use data:image/xxx;base64,XXXXX
format data string as PrevUrl value
Demo
InputUpload
ButtonUpload/CardUpload
AvatarUpload
B station related video link
交流群