When we are uploading the files to azure storage via django, it’s adding underscore if space or special characters are there in the filename and it’s disturbing the functionality. Is there anyway we can ignore it or change it. I tried multiple suggestions but it’s not working like custom storage options. If i’m trying the custom storage options, it’s not uploading in blob storage but it’s uploading project folder. Refer the code below i tried in custom storage,
from django.core.files.storage import FileSystemStorage
class CustomStorage(FileSystemStorage):
def _save(self, name, content):
return super(CustomStorage, self)._save(name, content)
def get_valid_name(self, name):
return name
file_path = models.FileField(upload_to=get_upload_path, max_length=1000, storage=CustomStorage())
I have tried other suggestions, but nothing worked