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
1
vote
1 answer

What are the downsides of using filesystem for storing uploaded files in django?

I know about s3 storage but I am trying to see if things can work out by only using filesystem
Elie Azzi
  • 11
  • 1
1
vote
1 answer

How does one alter a FileField of an object in Django?

I have a model called ClassFile that takes a FileField (document): class ClassFile(models.Model): timestamp = models.DateTimeField(auto_now_add=True, editable=False) document = models.FileField(upload_to="classFiles/%Y/%m/%d/") …
dangerChihuahua007
  • 20,299
  • 35
  • 117
  • 206
1
vote
1 answer

Django DRF when file is empty while updating it gives error - when file is selected it works

I have a view in DRF - when I select the image then it works fine but when no files are selected then it throws an error: The submitted data was not a file. Check the encoding type on the form.code invalid I have also tried conditionally putting…
1
vote
1 answer

How to save data to PostGis database from uploaded GPX file in Django?

I have the following problem: my goal is to make an archive of gps tracks that can be displayed on a map. (using Python, Django, PostgreSQL, PostGIS) I found a tutorial:…
1
vote
1 answer

User creation - email field and image field not updating Postgres

In an extended user model with User and Profile created together. The user and related profile(Customer) is created but two fields 'email'(user email) field and 'photo'(image field) is not saved into database. Appreciate some fix: views.py def…
1
vote
0 answers

Django Python can not upload directory with large quantity of files

I am trying to upload a directory with large number of dicom files using Django and JQuery ajax. Each file size is not more than 600kb. I can upload 200 files at a time. If I increase the number of files (tried to upload 14000 files), it doesn’t…
reasm001
  • 167
  • 1
  • 11
1
vote
0 answers

Folder / Directory with large files upload in Django

I am trying to upload a folder with multiple files that will be zipped before storing it into the database. I am following ajax file upload technique and Django/python to accomplish it. The following code is working fine when the file size is…
reasm001
  • 167
  • 1
  • 11
1
vote
0 answers

Getting BlobNotFound while configuring django static and media files

I have an Vuejs application running with Django framework, currently application running in production mode with static files are in local server, instead of serving files from location server want to keep in Azure storage Followed below URL and…
1
vote
1 answer

Save Django Form wizard data to three models with related fields

I am working on a project that requires use of form wizard to populate three related models. The first model - Listing - has general data which has a OneToOneField relationship with the second model (Property). The Listing model also has a many to…
japheth
  • 373
  • 1
  • 10
  • 34
1
vote
1 answer

Multiple file uploads not working in Form Wizard Django

I am working on a project that requires an upload of multiple images in one of the form wizard steps. The form wizard also has several models used for the wizard which I think complicates the whole process the more. Here is the relevant…
japheth
  • 373
  • 1
  • 10
  • 34
1
vote
0 answers

Django - Unique upload filenames regardless of file extension

I want to create unique filenames for each uploaded file (Similar to this), but regardless of the extension (ie, name.txt and name.dxf is a clash) I'm converting files on my server (ie, ogg, wav, etc) to a particular filetype extension, ie. mp3,…
Mr G
  • 244
  • 3
  • 10
1
vote
0 answers

Why i'm unable to open twice a django-uploded-file?

I would like to open an uploaded file in a validator to make sure the file is good, then if it's good re-open it in my view function to extract the data. I'm not sure if it supposed to be done like that. Tell me what you think. Here is my validator…
1
vote
1 answer

Writing in memory zip file to django FileField

Im trying to read files from FileField, put them all to zip and save that zip to another FileField. Im trying to avoid using temp file but it seems that i might have to. Here is what i got so far: def generate_codified_batch(modeladmin, request,…
MarkoBox
  • 95
  • 10
1
vote
1 answer

How can I delete the photo after proccesing it?

I have two fields in my django model: class Staff(models.Model): photo = models.FileField(blank=True, null = True) encodings = JSONField() I get the photo from form and after that using this photo get encodings. How can I delete the photo…
1
vote
2 answers

django ImageField - how to customise name + remove old file

I have a model with an ImageField in it. I've already set the upload_to and created my own FileSystemStorage class to deal with saving the file with a unique name... however... This setup allows me to upload and save a file with a unique name for…
Paul Johnston
  • 31
  • 1
  • 4