Opened 6 years ago

Closed 6 years ago

#30192 closed Bug (needsinfo)

Image upload failing on mobile

Reported by: Tammo Heeren Owned by: nobody
Component: File uploads/storage Version: 2.1
Severity: Normal Keywords: ImageField, Mobile, Upload
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I set up an Item model (simplified here):

class Item(models.Model):

    image = models.ImageField(
        blank=True,
        null=True,
        upload_to=user_directory_path
    )

with the following view class

class Create(generic.CreateView):
    template_name = 'items/create.html'
    model = Item
    fields = [
        'image',
    ]

and use the following template:

{% extends "base.html" %}

{% block title %}

New Item

{% endblock %}

{% block content %}

    <form
            method="post"
            enctype="multipart/form-data"
            data-ajax="false">
        {% csrf_token %}
        {{ form.as_p }}
        <input type="submit" value="Save">
    </form>

{% endblock %}

Image upload works fine using Desktop but fails using Mobile, seemingly without error message.

I also used

FILE_UPLOAD_MAX_MEMORY_SIZE = 10 * 1024 * 1024

in setting.py, but the behavior continues.

It surely must be possible to upload files from mobile, but I have a hard time finding out what is wrong here.

Change History (2)

comment:1 by Tammo Heeren, 6 years ago

Component: UncategorizedFile uploads/storage
Type: UncategorizedBug

comment:2 by Tim Graham, 6 years ago

Resolution: needsinfo
Status: newclosed

Please get help through TicketClosingReasons/UseSupportChannels. You should create a ticket (reopening this one would be fine) when (if) you determine that Django is at fault. You should include a lot more specifics about how to reproduce the issue. For example, "on mobile" means what, exactly?

Note: See TracTickets for help on using tickets.
Back to Top