Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sending attachments without filename #108

Open
leplatrem opened this issue Jul 18, 2016 · 0 comments
Open

Support sending attachments without filename #108

leplatrem opened this issue Jul 18, 2016 · 0 comments
Labels
enhancement stale For marking issues as stale. Labeled issues will be closed soon if label is not removed.

Comments

@leplatrem
Copy link
Contributor

leplatrem commented Jul 18, 2016

Use case: from kinto-http.js, being able to attach a file coming from a dataURI (without filename).

def save_file(content, request, randomize=True, gzipped=False):
    folder_pattern = request.registry.settings.get('attachment.folder', '')
    folder = folder_pattern.format(**request.matchdict) or None

    # Read file to compute hash.
    if not isinstance(content, cgi.FieldStorage):
        error_msg = 'Filename is required.'
        raise_invalid(request, location='body', description=error_msg)
@alexcottner alexcottner added the stale For marking issues as stale. Labeled issues will be closed soon if label is not removed. label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement stale For marking issues as stale. Labeled issues will be closed soon if label is not removed.
Projects
None yet
Development

No branches or pull requests

2 participants