Comments (10)
from django-file-form.
I'll check if the upload to the temp folder can be prevented.
About the permissions: one solution is to disable uploads. Would that be a solution? I think it's not possible at this moment to disable uploads. I'll check that.
from django-file-form.
A possible solution is to make the field disabled when the user doesn't have the permission to upload. Pr #680 adds support for disabled fields.
Another solution is to hide the field.
from django-file-form.
from django-file-form.
I'll check if it's possible to display an error message.
It's a good idea to check as early as possible if a user has permission to upload; the easiest solution is to make the check_permission
function configurable.
In the settings file:
def custom_check_permission(request):
if not request.user.is_authenticated:
raise PermissionDenied()
FILE_FORM_CHECK_PERMISSIONS_FUNCTION = custom_check_permission
Would that work in your situation?
from django-file-form.
from django-file-form.
I have another issue: to really determine if the upload should be allowed, I would need to get values from other fields of the form... I don't see how that would be at all possible...
So, guess that part comes down to the question of how to delete temp uploads on failed (or never triggered) save...
from django-file-form.
The form has a delete_temporary_files
method that removes all temporary files. So that's in the right direction.
I can have a look later if it's possible to remove files for a single field.
from django-file-form.
I added the method delete_temporary_files_for_field
in pr #689.
from django-file-form.
Does pr #689 fix the issue?
from django-file-form.
Related Issues (20)
- No proper error message when FILE_FORM_MAX_FILE_SIZE excceded HOT 6
- Option FILE_FORM_MAX_FILE_SIZE doesn't work HOT 2
- MultipleUploadedFileField in modelform return None input_files with S3 upload HOT 7
- Uncontrolled data used in path expression
- How to append input files instead of replacing when the user picks the files again? HOT 4
- Make cache timeout configurable HOT 6
- Getting 's3_upload' is not a valid view function or pattern name. despite setting up URLs to include django_file_form HOT 3
- Requested migrations when main project uses DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' HOT 4
- Django 4.1
- Code scanning alert
- Deployment issues HOT 4
- File / image preview HOT 13
- Can you provide a minimal example using file-form with AJAX - i.e. no HTML form HOT 1
- View uploaded images using JS HOT 1
- uploadComplete sends wrong element with multiple file forms on a page. HOT 5
- rename file_form.js to file_form.min.js? HOT 3
- Is it possible to initialize the file upload in React? HOT 1
- Support (or example) for Inlines HOT 4
- An image is 1000 words....
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-file-form.