Opened 16 years ago

Closed 16 years ago

Last modified 13 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: no UI/UX: no

Description

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 by Alex Gaynor, 16 years ago

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 by SirVer@…, 16 years ago

Hi,

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" />
		</div>
	</form>

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

Any more ideas?

Greetings,
SirVer

comment:3 by anonymous, 16 years ago

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:4 by Jacob, 16 years ago

(that was me)

comment:5 by Kevin Kubasik, 16 years ago

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

comment:6 by Kevin Kubasik, 16 years ago

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

comment:7 by SirVer@…, 16 years ago

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

comment:8 by Raphaël Braud, 16 years ago

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 by chr, 16 years ago

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

comment:10 by Kevin Kubasik, 16 years ago

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

comment:11 by Jacob, 16 years ago

Resolution: worksforme
Status: newclosed

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

comment:12 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

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