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
515
46.4k
Play/Pause functionality of File Upload in MVC
Jul 27 2020 4:24 PM
hello everyone,
I am uploading file with progress bar in my MVC app.
I want play/pause functionality to play or pause large files while uploading.
So that user can cancel or continue uploading that file.
My Code to upload and show progress bar is :
function UploadFile() {
var files = $(
"#fileuploadInput"
).
get
(0).files;
counter = 0;
// Loop through files
for
(var i = 0; i < files.length; i++) {
var file = files[i];
var formdata =
new
FormData();
formdata.append(
"fileuploadInput"
, file);
var ajax =
new
XMLHttpRequest();
ajax.upload.addEventListener(
"progress"
, progressHandler,
false
);
ajax.addEventListener(
"load"
, completeHandler,
false
);
ajax.addEventListener(
"error"
, errorHandler,
false
);
ajax.addEventListener(
"abort"
, abortHandler,
false
);
ajax.open(
"POST"
,
"http://localhost:56120/Handlers/Fileuploadhandler.ashx"
);
ajax.send(formdata);
}
}
Thank you
Reply
Answers (
1
)
Stackalloc in nested expressions
calendar perio in dropdown for current month only appearing two times?