Questions tagged [django-file-upload]

Django-file-upload refers to how django handles file uploads

Django-file-upload refers to how django handles file uploads.

See documentation.

325 questions
2
votes
1 answer

Module 'django.db.models' has no attribute 'FileBrowseField'

I would like to have on my Django 2.1.1 site django-filebrowser-no-grappelli. I've followed this indications but at the end of the procedure, when I restart my server, I've this error: header_image = models.FileBrowseField("Image", max_length=200, …
2
votes
1 answer

Set Original Filename as default title field in Django Model

I'm using the Django Admin Site to manage my uploads. I would know if it's possible to set the original filename title as default title of an Image class. Models.py: class Multimedia(models.Model): id_multimedia =…
2
votes
0 answers

Unzipping file submission without storage in Django

I'm currently building an application that will be used and maintained by another developer shortly in the future. What I want is the ability to upload a zip file, unzip and process the contents, and discard the file without ever actually storing it…
chemdog95
  • 366
  • 4
  • 16
2
votes
2 answers

Where/how to replace default upload handler in Django CBV?

I am trying to specify a specific method of handling file uploads for a class based view. Per the docs this can be achieved by something like: from django.core.files.uploadhandler import TemporaryFileUploadHandler request.upload_handlers =…
BartDur
  • 1,086
  • 1
  • 12
  • 21
2
votes
1 answer

Make django ajax view return a file

I'm having trouble when trying to return a file through a view. Working case: User submits a form, I instanciate an excel file from these values and return it to the user. After submitting, user got a popup inviting him to download the file. No…
May.D
  • 1,832
  • 1
  • 18
  • 34
2
votes
0 answers

Validating multiple files before uploading in Django

I am currently trying to create a Django app that allows a user to upload multiple .gpx files at once. I would like that when the files are validated the user is provided with a list of files and the reason they weren't uploaded. The file is…
Domronic
  • 149
  • 1
  • 1
  • 11
2
votes
0 answers

How to upload Image Files on Shared Host/ Shared Folder using Django, Python?

I have two application server 10.1.xx.xx and 10.1.xx.yy and middle of both I have load balancer 10.5.aa.bb and I have deployed my Django application in both the servers successfully and able to access the application too. There is a shared folder in…
Vikram Singh Chandel
  • 1,290
  • 2
  • 17
  • 36
2
votes
1 answer

Uploading image from Imagefield in django

I am new to Django.I have the following code on my html file: {% load staticfiles %}
{% csrf_token %}
{{file}}
chaitanya90
  • 697
  • 2
  • 8
  • 24
2
votes
1 answer

Django filestorage save method creates path dependent on filename

I am trying to work with a filestorage in Django. Everything is working fine but a thing in my save method I guess. I have a model with a FileField download_url = models.FileField(verbose_name = 'Konfig', upload_to = file_path, storage =…
ZedsWhatSheSaid
  • 467
  • 2
  • 9
  • 23
2
votes
1 answer

Django Filefield or imagefield - checking equality with another image or file

I have a model with an ImageField and there are around 100 instances of the model in the database. Some of these instances have the same bitmap image (but saved in different path locations, path = obj.first_name + obj.date_of_creation). I want to…
dowjones123
  • 3,695
  • 5
  • 40
  • 83
2
votes
3 answers

Django REST Framework FileField Data in JSON

In Django REST Framework (DRF), how do I support de-Serializing base64 encoded binary data? I have a model: class MyModel(Model): data = models.FileField(...) and I want to be able to send this data as base64 encoded rather than having to…
Alex Rothberg
  • 10,243
  • 13
  • 60
  • 120
2
votes
3 answers

Keeping Original Filename for FileField in Django

I would like to keep the original file name of an UploadedFile in Django that has its location stored in a FileField. Right now I am observing that if two files have the same name, the first file uploaded keeps its original name but the second time…
Alex Rothberg
  • 10,243
  • 13
  • 60
  • 120
2
votes
1 answer

Django: Form field input forgotten/deleted for FileField upon validation

I have the following setup in Django. A text input validated by CharField and a FileField for an image upload. The desired response for when a field is empty should be that the data originally on the form is present and all the user needs to do is…
Rich
  • 785
  • 1
  • 9
  • 22
2
votes
1 answer

Passing parameter to upload_to function in Django

I try to upload multiple images of an instance to different sub folders. But I need to rename each uploaded file as well so I implement a function for upload_to field as below. class MyModel(models.Model): code = models.CharField() logo =…
brsbilgic
  • 11,613
  • 16
  • 64
  • 94
2
votes
3 answers

"decoder jpeg not available" with Django on Elastic beanstalk

I am developing a Django backend system on Elastic beanstalk. When I upload JPEG image file, I get the error decoder jpeg not available. Uploading .png image files does not cause any problem. Backend environment: AWS beanstalk: 64bit Amazon Linux…