I have used File Upload for my projects over the past few days. To sum up, let's get a better impression. Hey ..........
1. To add a function, you need to upload an image and upload the code.
(Ajax. beginForm (, AjaxOptions () {HttpMethod =, OnSuccess = {id =, enctype = <tr> <td> icon address: </td> <td id = colspan => <input id = type = name =/> <input type = value = id =/> </td> </tr> <td> </td> <td id = colspan => </td> </tr>}
Mvc submits forms asynchronously. It is best to add the enctype = "multipart/form-data" attribute when uploading files.
2. jquery code for front-end triggering events.
$( ($( $( $( url: , type: , dataType: , $( $().append( + data + $().val( } $.messager.alert(, }
This is an asynchronous form submission. A MyAjaxForm. js file is required. Success: after the operation is successful, the system returns the image path from the background. The thumbnail is displayed on the foreground.
3. process Background uploads and provide code ..
Upload (Request. Files []! = RequestFile = Request. files [Fname = fileEx = (fileEx = | fileEx = imagePath = + DateTime. now. year ++ DateTime. now. month ++ DateTime. now. day + fileName = imagePath + Guid. newGuid (). toString () + Content (
This is basically the case. You can give me a lot of advice and exchange ideas .. O (partition _ partition) O