Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#10396 closed (worksforme)

Django File Upload /Image Upload Forms are broken with Safari (3 and beta 4)

Reported by: SirVer@… Owned by: nobody
Component: File uploads/storage Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Simple form:

class UploadImageForm(forms.Form):
    image = forms.ImageField()

When rendered, the choose file button is displayed, but clicking it doesn't work (nothing happens). The same page works fine in Firefox 3 on the same system. JS and HTML debugging facilities inside Safar do not mention any errors.

Change History (12)

comment:1 Changed 7 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

My inclination is that this is because safari added an input type image, and thus a field named image inexplicably breaks. Does this problem still occur with other field names?

comment:2 Changed 7 years ago by SirVer@…


didn't work out.

Heres the new form:

class UploadImageForm(forms.Form):
    funny_name = forms.ImageField()
    def clean_up_filename( self ):
        name = self.cleaned_data["funny_name"]

and heres the generated HTML

   <form  enctype="multipart/form-data" action="/images/upload/11/1/" method="POST">
        <p><label for="id_funny_name">Funny name:</label> <input type="file" name="funny_name" id="id_funny_name" /></p>
		<div class="submit">
			<input type="submit" value="Upload Image" />

Note that it is the second form on this page. The names do not clash and they POST to different adresses.

Any more ideas?


comment:3 Changed 7 years ago by anonymous

  • milestone set to 1.1
  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 7 years ago by jacob

(that was me)

comment:5 Changed 7 years ago by kkubasik

I'll take a look at this. See if I can't reproduce.

comment:6 Changed 7 years ago by kkubasik

Hmmm... I cannot replicate in admin, or does it need to be done outside of that?

comment:7 Changed 7 years ago by SirVer@…

Yes. needs to be done outside of admin. Please see my sample code provided above.

comment:8 Changed 7 years ago by raphael

Hum... I cannot replicate it even outside of admin (I used Safari 3.2.1 on MacOS). My assumption is that it is a Safari related problem.

Which version are you using ?

Did you try to load a sample file with the same HTML content to see if it is related to Django ?

comment:9 Changed 7 years ago by chr

cannot reproduce on safari 4 beta using the above form snippet.

comment:10 Changed 7 years ago by kkubasik

Can someone confirm if this is still around in Safari 4? I cannot seem to replicate in beta 4.

comment:11 Changed 7 years ago by jacob

  • Resolution set to worksforme
  • Status changed from new to closed

This appears to have been a Safari bug since nobody can confirm it.

comment:12 Changed 5 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

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