Skip to content

File download inside django-unicorn #486

@rjlinuxekoos

Description

@rjlinuxekoos

Hi!
I'm trying to download PDF files from the django runserver development server, "python manager.py runserver", inside a django-unicorn application, but I can't download them. Follow the code >
with open(os.path.join("c:/mydirectory/tmp", filename + '.pdf'), 'rb') as f:
data = f.read()

            response = HttpResponse(data, content_type='application/pdf')
            response['Content-Disposition'] = 'attachment; filename="' + filename + '.pdf"'
            
            return response

No error occurs, but accessing from another machine I can't download.
Is there any way to be reproduced?
Thanks!

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions