Questions tagged [filefield]

299 questions
0
votes
2 answers

Save a file using a model and non-model-based Form in Django

I have a model with a FileField and a form that has a FileField as well. The form is not a ModelForm based on the model but it's a regular Form. How do I save the uploaded file from the form to the model?
Tomas Andrle
  • 13,132
  • 15
  • 75
  • 92
0
votes
1 answer

Watir. file_field clears in IE9 after setting the filepath

When I try to set the path in a file field using browser.file_field(:name, "upload").set(file_path), the file field is cleared on IE9 after setting the file path. The same code used to work fine, and I was able to upload the document in IE8.
user3791
  • 391
  • 2
  • 9
0
votes
1 answer

File is not uploading when there are multiple fields in model form

I am unable to upload file if there are multiple fields in my model other than file field. I didn't get any error on the page but the page simply displays same page without uploading of my image. Here is my model class ImageUpload(models.Model): …
vkrams
  • 7,267
  • 17
  • 79
  • 129
0
votes
1 answer

FileField not uploading the file

I am relatively new to python and Django. The form is displaying itself, but when i choose a file and hit save, the form just refreshes itself and the selected file in the FormField disappears and the forms says that this filed is required. The code…
sankaet
  • 345
  • 2
  • 5
  • 12
0
votes
2 answers

Import CSV - No such file or directory

When I want to select a file via file_field, it gives me the error that my file is 'nil'. Here's the error: "No such file or directory - Book1.csv" May I know why? Below are the codes: controller def import_csv @list =…
user1480797
  • 185
  • 1
  • 4
  • 16
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
0
votes
1 answer

Django: Change filefield name from admin interface

I'm developping a Django interface and i have a problem changing name of an uploaded file. Here's a part of my model class Test(models.Model): var = models.IntegerField() var1 = models.ManyToManyField('OtherClass') file =…
user1336204
  • 177
  • 1
  • 1
  • 8
0
votes
1 answer

Django File Uploads using path

If I upload a file to my website via Ajax, and I have the path of it, is there a way I could submit this path to a Django form's built-in FileField?
zallarak
  • 5,287
  • 7
  • 38
  • 54
0
votes
1 answer

Django FileFields Using Values of DB Model

I have defined these models, class Header(models.Model): date1 = models.DateField() class Details(models.Model): header = models.ForeignKey(Header), field1 = models.CharField(max_length=10), archive =…
-1
votes
1 answer

How is the file from OneToOne Model's FileField accessed, read in views.py and passed to template?

I am developing a simple Data Visualization App, where a user can register, login upload a file and visualize its content. I am using default User model, and a Detail Model having OneToOne relation with User Model. The Detail has 3 fields, which…
Neha AK
  • 67
  • 1
  • 10
-1
votes
1 answer

plone.app BlobField and accessing file

In an archetype, I use a BlobField : from plone.app.blob.field import BlobField BlobField( name='gpx_total', widget=FileWidget( label='Gpx_total', label_msgid='FranceVeloTourisme_label_gpx_total', …
Jihaisse
  • 977
  • 5
  • 24
-1
votes
1 answer

AttributeError: 'file' object has no attribute 'open' in Django while assigning a local file to the FileField

Possible Duplicate: How to assign a local file to the FileField in Django? I was trying to assign a file from my disk to the FileField, but I have this error: AttributeError: 'file' object has no attribute 'open' My python code: pdfImage =…
Leodom
  • 471
  • 1
  • 5
  • 7
-1
votes
2 answers

How to display current image name from database in file field when editing in php?

I am using a file field in my webpage,my problem is when i clicking edit option in my webpage i want to show the current image name from database in the file field,now i cant show the image name so when clicking edit file field become blank and…
User
  • 360
  • 3
  • 4
  • 18
-2
votes
2 answers

Imagefield Crop – use existing file

Is there a way to make a few images with Image Crop out of one uploaded file? Currently i have to upload the same, big pic to get new pics with various dimensions. Unfortunately the "Imagefield sources"-module doesn´t support Image Crop. Is there an…
Arne Cordes
  • 581
  • 1
  • 6
  • 22
1 2 3
19
20