Questions tagged [filefield]
299 questions
0
votes
0 answers
Django delete() command
I'm building a web app in Django. There I have a model DocFile with a FileField upload.
class DocFile(models.Model):
name = models.CharField('Bezeichnung', max_length=100)
md5sum = models.CharField(max_length=32)
upload =…

ProjectBWS
- 1
- 3
0
votes
1 answer
Ruby on Rails 3 and Paperclip gem: custom presence validation on an attachment (no use of 'validates_attachment_presence')
I am using the 'paperclip' gem for Ruby on Rails 3 and I would like to handle a custom presence validation with this approach: "if a file path value (a string like "/Users/Desktop/image.gif" or "C:/Users/Desktop/image.gif") is not entered in the…

user502052
- 14,803
- 30
- 109
- 188
0
votes
2 answers
Making sure that only text files can be uploaded using f.file_field in Rails
I have = f.file_field "file", required: true, class: "filestyle" in my html.slim in Rails. How do I make sure that only text files with extension .txt can be uploaded, but not other files with other extensions like .png or .jpg

gogofan
- 533
- 1
- 10
- 20
0
votes
2 answers
Django migration fails using FileField with dynamic upload path
I'm trying to use the dynamic upload path, for django FileFiled.
This is my model:
def use_assignment_path(instance, filename):
return 'assignment/%s/%s' % (instance.name, filename)
class Assignment(models.Model):
admin =…

Max
- 1,368
- 4
- 18
- 43
0
votes
1 answer
In Rails the file_field helper is not allowing multiple selections to appear in params hash returned to controller
I have a multiple select dialog that is only returning one file to the controller in the params hash when multiple files are selected.
Rails 5.0.1
<%= form_for(@out_transfer) do |f| %>
<%= f.file_field :pdf, multiple:…

user6337901
- 19
- 6
0
votes
0 answers
Which file format django imagefield(filefield) requires?
I use django-rest-framework first time. I use json format by default.
I need to send file for creating a new instance. This file has being saved in models.ImageField. However, I don't know which format this field requires for incoming file. I tried…

Alexander Shpindler
- 811
- 1
- 11
- 31
0
votes
1 answer
Django email attach method is not taking parameters right
My problem is that while sending email in django i want to attach a file.
If i do it that way:
email.attach("Random_name", uploaded_file.read())
it works and my email sends. But if instead of string "Random name" i put a variable there…

Ilja Leiko
- 426
- 2
- 7
- 22
0
votes
1 answer
How to get the name of the file from the filefield?
I know this question has been asked a lot of times but I am not able to find a nice solution to this. Here is my model:
class Song(models.Model):
song_title = models.CharField(max_length=200, null=False, blank=False)
audio_file =…

blacklight
- 130
- 1
- 2
- 11
0
votes
0 answers
“Form submission canceled because the form is not connected” error in new chrome version with ExtJS 6 & Sencha Architect 4
When I submit my form, I get the error “Form submission canceled because the form is not connected” in new Chrome Version. Note that I use a file field inside the form panel.
The form was developed using ExtJS 6 Modern Toolkit.
The code for my…
0
votes
1 answer
Python flask heroku - Image Upload Field (WTForms) makes APP timeout (takes too long)
I have currently an app deployed on heroku.
It is live since 1 day and I noticed in the logs that users get often an H13 or H28 error on a certain site.
I already found the problem. On this site users are able to upload images (max. 10). I use…

Roman
- 3,563
- 5
- 48
- 104
0
votes
3 answers
Retrieve files from local directory in django
I found myself in a situation where a client asked if we can serve the files in the web app withought him uploading them. Instead he wants to drop the files in a local directory. Let's say in '/Desktop/myfiles/'.
Question #1 = Is it possible to…

Danae Vogiatzi
- 178
- 5
- 23
0
votes
1 answer
How to display filefield in the grid cell in ExtJS
I have created a grid on the form and I am displaying records dynamically, and I am using cell editor to edit the comments column and in another column using filefield to browse a file and displaying its full path in the attachment column.
See the…

TARUN KUMAR
- 31
- 8
0
votes
1 answer
TypeError when open object of django filefield
I want to make a button named 'count' to count the number of page of the uploaded pdf file. However, there is TypeError invalid file:
How can I improve my code to tackle this error...?
PS. I'm newbie in coding using django 1.10, and just want to…

Patrick Yip
- 3
- 1
0
votes
2 answers
quick question: how to associate a file with an ImageField in django?
i have an image saved on my HDD and i want to assign it to an ImageField, but i don't know how.
i've tried something like this:
object.imagefield.save(path,File(open(path)))
But this makes an additional (invalid) copy of the image.
Can someone help…

amannn
- 45
- 5
0
votes
2 answers
Django FileField not including uploaded file in form output request
I am having trouble getting access to a simple uploaded file which I need to parse without saving it. Since the file does not need to be saved I have not made a model for it. All other threads on this state the html form encoding type, name tag are…

petko
- 1
- 1