Skip to content

Commit

Permalink
limit video size to 30mb
Browse files Browse the repository at this point in the history
  • Loading branch information
manikandanraji committed Jul 7, 2020
1 parent f96a9d4 commit e456e93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/UploadVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const UploadVideo = () => {
const handleVideoUpload = async e => {
const file = e.target.files[0];
if (file) {
// const size = file.size / 1000000;
const size = file.size / 1000000;

// if(size > 30) {
// return toast.error('Sorry, the file should be less than 30MB');
// }
if(size > 30) {
return toast.error('Sorry, the file should be less than 30MB');
}

const url = URL.createObjectURL(file);
console.log(url)
Expand Down

0 comments on commit e456e93

Please sign in to comment.