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

Weird behavior in request.FILES and File and handler in Django

I have a request that is uploading two files at once. The FILES attribute of the request object looks like this: ], u'history': [
Jon
  • 1,122
  • 8
  • 10
0
votes
1 answer

Submitting files to django server from outside via Ajax

From client side A, I want to create a file on the fly by javascript and send it to a Django server B via Ajax for further processing. The javascript code in A is like below. I use blob to create a file without a real uploaded one and send it via…
Loi.Luu
  • 373
  • 3
  • 15
0
votes
2 answers

Displaying uploaded media in a web page

Friends, I am using Django 1.6 and I have for the last week(!) been trying to display photos on a web page that are uploaded via the Django Admin site. I know this is a common problem. I have tried reading the documentation, numerous SO questions…
Ian Carpenter
  • 8,346
  • 6
  • 50
  • 82
0
votes
0 answers

Execute a function from an uploaded file

I have a site, where I want to run a code from an uploaded file from every 2 hours. So the user can upload many files and choose which one is the active. After the two hours, I check the database for 'active' files, and I want to import that file,…
Nagy Vilmos
  • 1,878
  • 22
  • 46
0
votes
1 answer

Django File Upload: How do I handle the file?

I have read the documentation several times, but I am still confused. When you specify a model in Django, you can specify the file's destination. However, in the documentation, they go on a great deal about handling the write to disk manually. My…
SapphireSun
  • 9,170
  • 11
  • 46
  • 59
0
votes
1 answer

Form validation error for ImageField and MemoryFileUploadHandler

There is a form with ImageField, which returns validation error "Upload a valid image. The file you uploaded was either not an image or a corrupted image." In my view I am trying to read image file content: image =…
sunprophit
  • 1,639
  • 4
  • 16
  • 39
0
votes
0 answers

Creating a progress bar when uploading files

I'm trying to create a progress bar when the user is uploading a file, but it is not throwing the json to create the progress bar. I have handler.py: from django.core.files.uploadhandler import FileUploadHandler from django.core.cache import…
Marco
  • 315
  • 1
  • 3
  • 13
0
votes
1 answer

changing UPLOAD_DIR for django-ajax-uploader

Newbie here sir. I manage to install django-ajax-upload to my django study project. And using it's initial view, url and template to see how it works. I successfully uploaded a file to it's default directory 'upload'. Now, I'm trying to change the…
Charlesliam
  • 1,293
  • 3
  • 20
  • 36
0
votes
1 answer

modelForm giving a validation error on file upload

I'm trying to do a bare bones files upload, but there seems to be a problem while validating the model form. Here's my model: class quiz(models.Model): user = models.ForeignKey(User) title = models.CharField(max_length=200) …
Shouvik
  • 23
  • 2
0
votes
1 answer

Django FileSystemStorage get_available_name return name and count

I hope someone could point me into the right direction. The default Django FileSystemStorage function get_available_name returns just the name which is then stored in the db for the corresponding FileField. The original get_available name look like…
Jingo
  • 3,200
  • 22
  • 29
0
votes
1 answer

Python/Django :How to open file in xlrd using file object.

Background: I have uploaded a xls file using the FileField. Now I want to parse this file using the xlrd tool. While doing so I am doing the following in the view. if form.is_valid(): user_file = form.save() user_file.save() …
Akash Deshpande
  • 2,583
  • 10
  • 41
  • 82
0
votes
1 answer

django model filefield having db error

I am using django 1.4 and using django model's filefield to upload some document via modelform. I am having following issues: When I submit form it says: Data truncated for column 'file_name' at row 1 Following is my model for this: class…
Hafiz
  • 4,187
  • 12
  • 58
  • 111
0
votes
2 answers

django python cumulus - How to deal with uploading a large number of files to cloud file storage

I have a number of files processed and saved in temp folder on my server and I now want to move them into my default_storage location, (default_storage is set to rackspace cloud files using django-cumulus). The process begins uploading the files…
Finglish
  • 9,692
  • 14
  • 70
  • 114
0
votes
2 answers

Overwrite over a file and delete old model's object if the file exists

I have made something to overwrite a file already uploaded with : class OverwriteStorage(FileSystemStorage): def get_available_name(self, name): if self.exists(name): os.remove(os.path.join(settings.MEDIA_ROOT, name)) return…
nlassaux
  • 2,335
  • 2
  • 21
  • 35
0
votes
1 answer

Use FTP rather than HTTP for file transfer in Django

Is there any way to transfer huge files in Django using FileField..because eveytime i do using simple upload handler the Connection Timeout error occurs because of huge traffic generated. I was thinking of using FTP for the same but do not know how…
Karan
  • 239
  • 4
  • 13
1 2 3
21
22