- fixed file size bug
This commit is contained in:
@@ -65,7 +65,7 @@ const SoundUpload = () => {
|
|||||||
className="mt-4 w-full flex flex-col items-center justify-center rounded-2xl border border-slate-800 bg-slate-900/40 p-10 text-center file:px-3 file:border file:border-gray-500 file:rounded-lg file:bg-blue-800 file:mr-5"
|
className="mt-4 w-full flex flex-col items-center justify-center rounded-2xl border border-slate-800 bg-slate-900/40 p-10 text-center file:px-3 file:border file:border-gray-500 file:rounded-lg file:bg-blue-800 file:mr-5"
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
if (e.target?.files && e.target?.files[0]?.type === "audio/mpeg") {
|
if (e.target?.files && e.target?.files[0]?.type === "audio/mpeg") {
|
||||||
if (e.target.files[0].size / (1024 * 1024) <= 1) {
|
if (e.target.files[0].size / (1024 * 1024) >= 1) {
|
||||||
toast.error("File is too large. Max size is 1MB");
|
toast.error("File is too large. Max size is 1MB");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user