Skip to content

feat(dashboard): add file upload support - #284

Merged
ApusBerliozi merged 6 commits into
pyfenn:mainfrom
Hitesh-XS:hitu
Jul 28, 2026
Merged

feat(dashboard): add file upload support#284
ApusBerliozi merged 6 commits into
pyfenn:mainfrom
Hitesh-XS:hitu

Conversation

@Hitesh-XS

Copy link
Copy Markdown
Contributor

Summary

This PR adds file upload support to the Fenn dashboard, allowing users to upload datasets and other files directly through the web interface. It also adds a view of previously uploaded files with basic metadata.

Closes #249

Changes

Dashboard

  • Added a new Uploads page.
  • Added an Uploads entry to the dashboard sidebar.
  • Added an upload form with CSRF protection.

Backend

  • Added POST /api/uploads to handle file uploads.
  • Added GET /api/uploads to list uploaded files.
  • Added configurable upload directory support.
  • Added filename sanitization using secure_filename.
  • Added duplicate filename detection.
  • Added server-side validation and filesystem error handling.

Frontend

  • Implemented AJAX-based uploads to avoid page refreshes.
  • Added upload success and error messages.
  • Automatically refreshes the uploaded files list after a successful upload.
  • Displays uploaded filename, file size, and last modified timestamp.

Tests

Added unit tests covering:

  • Successful file upload
  • Missing file validation
  • Empty filename validation
  • Filename sanitization
  • Invalid filename handling
  • Duplicate upload detection
  • Listing uploaded files
  • Empty upload directory
  • Upload page rendering

Testing

The following checks were run successfully:

python -m pytest tests/unit/dashboard -q
python -m ruff check fenn tests
python -m ruff format --check fenn tests

@Hitesh-XS Hitesh-XS mentioned this pull request Jul 27, 2026
@ApusBerliozi

Copy link
Copy Markdown
Contributor

Hey @Hitesh-XS!

Thx 4 your work :) Please check why pre-commit is failing

Comment thread fenn/dashboard/app.py Outdated
Comment thread fenn/dashboard/app.py Outdated
Comment thread fenn/dashboard/app.py Outdated
@ApusBerliozi

Copy link
Copy Markdown
Contributor

@Hitesh-XS, kindly resolve merge conflicts and comments above, and we will merge your PR

@Hitesh-XS

Copy link
Copy Markdown
Contributor Author

@Hitesh-XS, kindly resolve merge conflicts and comments above, and we will merge your PR

yeah sure i will update it Rn i am in class will come to it later Thanks for quick review ;)

@ApusBerliozi

Copy link
Copy Markdown
Contributor

@Hitesh-XS, kindly resolve merge conflicts and comments above, and we will merge your PR

yeah sure i will update it Rn i am in class will come to it later Thanks for quick review ;)

No worries man

Take your time :)

@ApusBerliozi ApusBerliozi added enhancement New feature or request dashboard Relates to dashboard feature labels Jul 28, 2026
@ApusBerliozi

Copy link
Copy Markdown
Contributor

Thx 4 fast reaction @Hitesh-XS

Kindly check why CI pipeline is failing

@Hitesh-XS Hitesh-XS closed this Jul 28, 2026
@Hitesh-XS

Copy link
Copy Markdown
Contributor Author

wait did some thing went wrong ?

@ApusBerliozi ApusBerliozi reopened this Jul 28, 2026
@ApusBerliozi

ApusBerliozi commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@Hitesh-XS, we migrated to whenever today, so that was the cause of errors. Kindly check this PR

@Hitesh-XS

Copy link
Copy Markdown
Contributor Author

@Hitesh-XS, we migrated to whenever today, so that was the cause of errors. Kindly check this PR

yeah merged and updated it

Comment thread fenn/dashboard/app.py Outdated
@ApusBerliozi

Copy link
Copy Markdown
Contributor

Yep, everything looks cool now

Thx for your work @Hitesh-XS! Please star our project to help us grow :) You can also join our Discord if you want

@ApusBerliozi
ApusBerliozi merged commit aba1441 into pyfenn:main Jul 28, 2026
7 checks passed
@Hitesh-XS

Copy link
Copy Markdown
Contributor Author

@ApusBerliozi Thx for giving a chance to rookie like me this was comparatively big contribution i made first time :)

@ApusBerliozi

ApusBerliozi commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Congrats man :)

Everyone start with something

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

Labels

dashboard Relates to dashboard feature enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dashboard]: Add an opportunity to upload files to a dashboard

2 participants