Skip to content

Fix Improper File Validation in Banner Image Upload (Prevent Internal Server Error) #195

Description

@Muhammed-Ameen-T

Here's a structured bug report based on your issue:


Describe the bug

When attempting to upload a PDF file instead of an image in the banner image upload section while creating a post, the system fails to handle the validation correctly. Instead of displaying an appropriate error message, it results in an internal server error.

To Reproduce

Steps to reproduce the behavior:

  1. Navigate to the Create Post page.
  2. Click on the Banner Image Upload option.
  3. Select and upload a PDF file instead of an image (e.g., JPG, PNG).
  4. Click on the Submit button.
  5. Observe that an internal server error occurs instead of a validation warning.

Expected Behavior

The system should properly validate the uploaded file format and display a relevant error message instead of allowing a non-image file to be uploaded and causing an internal server error.

Screenshots

Attached

Additional Context

  • The issue suggests a missing validation check for file formats during upload.
  • Ideally, the system should restrict accepted formats to image file types only and provide clear feedback if an invalid format is uploaded.

Let me know if you need any modifications or additions! 🚀 ### `

Image
Image

`

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions