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
0
votes
1 answer

media files aren't served to template in django

I trying to serve media files to the template but make them inaccessible from url, and the opposite is happening when i do: http://localhost:8000/media/210000002A.tif I get prompted to download the files so it is being served when accessing from…
0
votes
1 answer

How to save multiple files under in 1 django model

I'm fairly new to Django. I have a model copy (exam copy of a student), the model copy will contain a student test or exam copy and a mark, usually, i would use a FileField and save the copy to the object, but my problem is that a copy could contain…
Mohamed Benkedadra
  • 1,964
  • 3
  • 21
  • 48
0
votes
0 answers

How to upload a folder to django database through form

I want to upload a folder containing few files, and save those files to the database. I was successful in uploading a file, but facing problem while trying to upload a folder. The files does not get stored in the database. Can someone please tell me…
0
votes
1 answer

How can I track place where file has been uploaded to the server?

Tell me please, can I determine when loading files from a directory it was loaded? InMemoryUploadedFile contains only the file name. I.e. simply Foto.jpg. I would like to see there for example: c:\windows\blablabla\Foto.jpg. Or is it…
moskrc
  • 1,220
  • 1
  • 12
  • 23
0
votes
1 answer

File Upload fails using ModelForm - no error messages though

I'm using ModelForms with the generic editing views (create, update, delete). One of my aims in this exercise is to get to know some frameworks (Django + Bootstrap + a plugin (e.g. PDF.js)) and use as little custom code as possible. I can create a…
Atcrank
  • 439
  • 3
  • 11
0
votes
2 answers

How to save a file to a model using upload_to for dynamic paths

I am trying to create a folder for each users to put their project in. So their file will have the path ..\project\id\filename, id is the user id and filename is the name of the file. Now using the arguments allowed for upload_to (instance and…
Jam1
  • 629
  • 12
  • 25
0
votes
1 answer

clean() method causes files to lose data using POST form

I have set up a form and view to upload multiple *.gpx files to my website at once. These files are validated using a clean() method on the form and then once validated passed to a function for processing. When I upload some invalid files the…
Domronic
  • 149
  • 1
  • 1
  • 11
0
votes
1 answer

Django - acces image from image field in the template

What I have done: in models.py: class Image(models.Model): img = models.ImageField(blank=True, Null=True) And now I want to acces the image in the template. I tried it, but it didn't work: (myimg is an instance of Image.)
Asqiir
  • 607
  • 1
  • 8
  • 23
0
votes
1 answer

Django not saving file to FileField. IOError: File not open for reading

I have this Django code, I can't save the file to the models FileField: # create stocklist object and populate it stocklist = StockList.objects.create(retailer=retailer) with open("retailer_stocklist.csv", "wb") as csv_file: for…
Alejandro Veintimilla
  • 10,743
  • 23
  • 91
  • 180
0
votes
0 answers

File size upload restrictions in Django when using Django-filer

I have no idea where else to post this, I am using django-filer (https://django-filer.readthedocs.io/en/latest/) and running into limits when trying to upload files. The problem is the software fails silently and does not give any errors and acts…
Codejoy
  • 3,722
  • 13
  • 59
  • 99
0
votes
1 answer

Error trying to serve user uploaded files locally

I'm trying to serve user-uploaded images locally on Django 1.10. I'm following the documentation here and getting this error: SystemCheckError: System check identified some issues: Your URL pattern [.*)$>] is…
YPCrumble
  • 26,610
  • 23
  • 107
  • 172
0
votes
1 answer

Django attach file with ajax

I have bootstrap modal in my template: div class="modal fade" id="offerModalForm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
0
votes
1 answer

Django - how to make temporary (on disk) file from uploaded (memory) file?

I'm working on a project where user uploads a file during creating the order. The file is sent through AJAX to a view and then recognized number of words which returns back. For this purpose, I want to use textract module. The problem is that I…
Milano
  • 18,048
  • 37
  • 153
  • 353
0
votes
1 answer

Why Django forces me to upload an image if I upload a file?

I have this really simple Django-Rest-Framework task app which does now behave the way I expect. Both image and file upload work so does the url routing their urls. However when I upload only Doc to new Task I get following error > { "image":…
0
votes
1 answer

uploading image to django rest model

I am trying to upload image to Images folder which under the media directory. I am using following APIView on my views.py; class FileUploadView(APIView): parser_classes = (FileUploadParser,) def post(self, request, format='jpg'): …
cnian
  • 239
  • 4
  • 18