TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
2.1k
469.8k
How to display table when creating bootstrap file-upload?
Sep 10 2020 5:54 AM
Hi team
I need some help, i have created file-upload the idea i want to display a table, that will have 'FileName', 'DateCreated', 'DateModified', 'ModifiedBy', 'Size'. Image below is an example. This is what i have done so far
// File-Upload.
[HttpGet]
public
ActionResult FileIndex()
{
RegCoursesViewModel model =
new
RegCoursesViewModel();
//ViewBag.FileIndex = this.FileIndex();
return
View(model);
}
[HttpPost]
public
ActionResult FileIndex(HttpPostedFileBase files)
{
// verify that user select a file.
if
(files !=
null
&& files.ContentLength > 0)
{
//extract only the filename.
var fileName = Path.GetFileName(files.FileName);
// store the file inside ~/App_Data/uploads folder.
var path = Path.Combine(Server.MapPath(
"~/App_Data/uploads"
), fileName);
files.SaveAs(path);
}
return
RedirectToAction(
"FileIndex"
);
}
public
class
eNtsaFileUpload
{
[Key]
public
int
? Id {
get
;
set
; }
public
string
FileName {
get
;
set
; }
public
DateTime DateCreated {
get
;
set
; }
public
DateTime DateModified {
get
;
set
; }
public
string
Modified_By {
get
;
set
; }
public
byte
[] Size {
get
;
set
; }
public
string
FileUrl {
get
;
set
; }
public
IEnumerable<eNtsaFileUpload> FileList {
get
;
set
; }
}
<center>
@
using
(Html.BeginForm(
"FileIndex"
,
"Home"
, FormMethod.Post))
{
<div
class
=
"form-horizontal"
>
<div
class
=
"form-group row"
>
<div
class
=
"col-xs-3 ml-auto"
>
<label
class
=
"custom-file-upload"
>
<i
class
=
"fa fa-stack"
></i>Upload
<input type=
"file"
/>
</label>
</div>
</div>
</div>
}
</center>
Reply
Answers (
1
)
Could not load file or assembly 'Microsoft.Office.Interop.Excel
React JS or Angular