Skip to content

Fix Upload Validation Issue (#1)#1

Open
jorjishasan wants to merge 1 commit intoinifarhan:mainfrom
jorjishasan:fix/upload-validation-issue-#1
Open

Fix Upload Validation Issue (#1)#1
jorjishasan wants to merge 1 commit intoinifarhan:mainfrom
jorjishasan:fix/upload-validation-issue-#1

Conversation

@jorjishasan
Copy link

Screenshot 2023-12-10 at 9 16 33 AM

As you can see, clients can upload any type of file. As instance I uploaded zipped file.

Changes Made

  • Modified upload logic to only accept image files.
  • Added additional checks for file types in the upload process.

@vercel
Copy link

vercel bot commented Dec 10, 2023

Someone is attempting to deploy a commit to a Personal Account owned by @inifarhan on Vercel.

@inifarhan first needs to authorize it.

@inifarhan
Copy link
Owner

Wow, thanks for your contributions I really appreciate it, but the validation is not working either for me.
You define the filetype of the uploaded file like this const fileType = result.info.format.toLowerCase();
but when the users upload a file that does not have the image format, the result seems like this 👇

result cloudinary
So an error occurred because the result.info.format is not defined. the result.info.format only exists when users upload an image filetype:

upload image cld

I think we can try another validation logic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants