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
0 answers

upload file in django admin without model and get rid of InMemoryUploadedFile [solved]

I want to upload a CSV file in the admin that adds information to a model. In case you can live with a normal form and not a extension of change_form.html and not overwriting response_change (I tried that fist) this is how it can be done: from…
xtlc
  • 1,070
  • 1
  • 15
  • 41
0
votes
1 answer

how to use a media file in a django view, in other words, how do i get the address of the media file in a view

I have Included the following in my settings.py: MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') This is the model whose FileInput i have to store: class Clip(models.Model): owner = models.ForeignKey(User,…
0
votes
1 answer

Can i upload files in one django filefield as a list of files?

I have created a webpage where a candidate can apply for jobs. There, they can list different previous experiences. I am handling all experience details by concatenating them in my models and splitting them while fetching. how should I handle files…
HarshitaJaya
  • 9
  • 1
  • 3
0
votes
1 answer

"redirect" function of django is not working and after submitting the form, user remains on same page

In the function "createProject" of views.py, I want that after submitting the form user should redirect to the "projects" page. But I don't know what is my mistake here. After submitting the form it does not redirect the user to "projects" page but…
0
votes
0 answers

"File upload" button not visible in django (visible in django admin panel though)

I don't see "File upload" button in document section of my front-end part and it's coming as a drop down list but it is visible in the admin panel, I'm new to Django, can you please help me to point out what is the mistake I'm making? [Thank You in…
0
votes
1 answer

when I post file data, it contains null value

def image_saving_product(instance, filename): return '/'.join( ['product', str(instance.id), filename] ) models.py class Image(models.Model): image_file = models.ImageField(blank=True,upload_to=image_saving_product,null=False) product =…
user15446178
0
votes
2 answers

django - Dynamic upload path including month and year not working

I want to upload file with dynamic path i.e. YEAR/MONTH//FILES To achieve this i am using below code def user_directory_path(instance, filename): return '%Y/%B/{0}/files/{1}'.format(instance.retailer.retailer_id, filename) class…
Ronak
  • 187
  • 2
  • 17
0
votes
1 answer

JSON file upload in Django without saving

I want to upload, process and discard a JSON file without saving it in a database. views.py parser_classes(['FileUploadParser']) @api_view(['POST']) def upload_file(request): file = request.FILES.get('file') # process the file return…
0
votes
1 answer

Error Trying to save Image to django model

I used beautiful soup to scrape and extract images from a website describe below successfully but when I viewed the extracted images they appear as Url as shown below. I then experience difficulty in attempting to save the scraped image to my…
0
votes
1 answer

django - How to upload file to local and remote server directory at same time

I am implementing a feature in django where file uploaded by user should be saved in both local system and remote server location also. I am able to do both the process individually but not together. Is there any way we can upload a file to both the…
Ronak
  • 187
  • 2
  • 17
0
votes
0 answers

'ImproperlyConfigured at /admin/filebrowser/browse/ Error finding Upload-Folder (site.storage.location + site.directory).(Django File Browser) '

My project structure is main -temp project -settings.py I want to browse main/temp/ folder while navigating to the link: localhost:8000/admin/filebrowser/browse Please help me with the correct settings of the django file browser, since the…
0
votes
1 answer

Failed - No file Downloading uploaded files in Django

I have a model here in Django in which an entity can have several uploaded files: from django.db import models from model_utils.models import TimeStampedModel from .managers import ProviderManager class Provider(TimeStampedModel): full_name =…
0
votes
1 answer

What is the correct way to change FILE_UPLOAD_MAX_MEMORY_SIZE in django?

If I change FILE_UPLOAD_MAX_MEMORY_SIZE, do I have to change DATA_UPLOAD_MAX_MEMORY_SIZE as well? Django default: DATA_UPLOAD_MAX_MEMORY_SIZE = 2.5 Mb FILE_UPLOAD_MAX_MEMORY_SIZE = 2.5 Mb My api expects two files in a json request. Storing these…
ABN
  • 1,024
  • 13
  • 26
0
votes
0 answers

How to globally tell Cloudinary to automatically decide the type of file in Django?

I use cloudinary as the default media storage for my Django project so I just setup it like this: settings.py INSTALLED_APPS = [ 'cloudinary' ] DEFAULT_FILE_STORAGE = 'cloudinary_storage.storage.MediaCloudinaryStorage' …
Alex Burla
  • 127
  • 1
  • 14
0
votes
1 answer

Django - Image not saving from form

I am getting an error setting up this Django web app. I receive a 505 error message whenever I hit the submit button. The image is supposed to be saved in the root directory, but I can't seem to figure out the problem. Below is the code for the web…
saucypanda
  • 37
  • 1
  • 8