Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
1.CCK 6.x-2.1
2.Imagefield 6.x-3.0-alpha4
3. 777, 777
4. public
5. GD2
6. Expect file to upload and preview to appear in browser
7. The spinner next to the "upload" button spins infinitely (only in safari -- firefox works fine)
8.
Steps
1. Click on "Choose File"
2. Select a file (file selection happens ok)
3. Click "Upload"
4. Spinner starts moving but never stops
note: the infinte loops happens for the remove button as well
Comment | File | Size | Author |
---|---|---|---|
#32 | safari_upload-6.x-0.1.tar_.gz | 1.18 KB | davidredshaw |
Comments
Comment #1
jphelan CreditAttribution: jphelan commentedSame here
Comment #2
rootdownmedia CreditAttribution: rootdownmedia commentedJust realized that if I select files via 'Browse' but don't click the upload button then submit the form, the images are uploaded. However, I can add additional images using the "Add another image" button.
Comment #3
quicksketchSo it's not explicitly stated, but does ImageField work in other browsers for you?
Comment #4
rootdownmedia CreditAttribution: rootdownmedia commentedYup works on Firefox fine
Comment #5
PGiro CreditAttribution: PGiro commentedI am getting the same thing Chrome/PC.
Upload spins forever + if I submit the page I get redirected to /filefield/ahah/picture/field_image/0
If I don't upload file (but do chose it) and then submit, everything is fine
Comment #6
quicksketchCould someone confirm this is a problem in the beta1 or development versions? I still can't reproduce any of these problems in Safari. Note, I'd recommend upgrading to CCK 2.2 that came out today, as it also fixes some problems with the "more" button provided for multivalue ImageFields.
Comment #7
rootdownmedia CreditAttribution: rootdownmedia commentedHey quicksketch,
Im using ImageField 6.x-3.0-alpha4 with Safari 3.2.1. Upgrading to CCK 2.2 now and will hit you w/ results
Comment #8
rootdownmedia CreditAttribution: rootdownmedia commentedNo luck with CCK 2.2. Still get an infinitely looping spinner in Safari
Comment #9
quicksketchrootdownmedia, could you try with the new versions of FileField and ImageField (beta3 or higher versions)? If it is a problem with ImageField, the only way it's going to be fixed is in new versions, as far as I know it's been fixed already.
Comment #10
rootdownmedia CreditAttribution: rootdownmedia commentedUpdated both FileField and ImageField but no joy...
Comment #11
quicksketchSorry, but I really just can't reproduce this problem at all. Have you tried a fresh Drupal install with just FileField and CCK? I'm suspecting another module might be interfering that I don't have on my installation. What other modules do you have installed on the site that affect the node form (wysiwygs, other cck fields, etc)?
Comment #12
falk_g CreditAttribution: falk_g commentedNot only 6.x version affected also 5.x 2.x version have same problem. Its a WebKit (Chrome, Safari) bug that not always happens but on like 1/3rd of the tries (it is even worse with the latest nightly builds of webkit). There does not seem to be a workaround and its not only related to drupal/image upload but to file upload in general - I read somewhere that it oddly happens only when there is a CSS switch of the upload form to "display:none" as this happens with image upload its worth investigating.
Comment #13
quicksketchI'm unable to fix this until it can be reliably reproduced. I'm not able to reproduce this problem despite using Safari on daily basis.
Comment #14
quicksketchAll interested parties, see https://bugs.webkit.org/show_bug.cgi?id=5760.
The conclusion (that I've been able to discern) is that this is a bug somewhere between Webkit and one of the core foundations of Mac OS X. The Webkit (aka, Safari) team is unable to fix the problem and is relying on Apple to fix the problem in Mac OS X. This problem still exists as of the most recent release (10.5.6). Anyone looking to solve this problem should follow the Webkit issue link above.
Comment #15
quicksketchA further note, it seems that Mike Alsup has built a work-around into the newer versions of jquery.forms.js (the library Drupal depends on for all its AHAH behaviors).
Anyone experiencing the problem might be able to replace their jquery.forms.js (in the "misc" directory of Drupal core) file with a new copy from http://malsup.com/jquery/form/#download. I haven't tried this, but I can't seem to make the issue appear on my sites anyway to test it out. It does seem that upgrading the library won't have any negative effect.
Comment #16
quicksketchComment #17
mepho CreditAttribution: mepho commentedThis happens in 5.x 2.x also, there is no jquery.forms.js used in drupal 5 misc folder.
Comment #18
brendymullan CreditAttribution: brendymullan commentedsame here! Please someone find a fix for this! My safari and chrome dumps a large piece of code when I click "Upload"
Comment #19
Garrett Albright CreditAttribution: Garrett Albright commentedFor the record, I also have experienced this problem when using WebKit-based browsers, but only when the site is local; that is, when it's being served from the same computer I'm using to browse it. Thus, it's only happening in testing conditions. I've never had this problem once the site is live and up on a remote server. I can't help but wonder if it's a race condition - if the relatively little network overhead means the upload is finishing before WebKit is ready for it to finish. (I don't think it's an OS X problem if it's also happening for Chrome on Windows…)
EDIT: Actually, it has happened when someone else in our office was using a site being served from my computer via our local network too. Again, maybe there just wasn't enough lag…
Comment #20
mattgilbert CreditAttribution: mattgilbert commentedsubscribing. would love to hear results from anyone who tried replacing jquery.forms.js.
Comment #21
swopit CreditAttribution: swopit commentedI have the same problem. Some solution would be highly apreciated.
I replaced the jquery.forms.js, but without success.
Comment #22
yonailo CreditAttribution: yonailo commentedsubscribing.
Comment #23
1websitedesigner CreditAttribution: 1websitedesigner commentedI had briefly got ImageAssist to work on Safari, but Safari have now 'upgraded' to a new version and Image Assist has stopped working on all of my sites with Safari (it's fine on the PC or using Firefox with the Mac, for all but one site, which I'm going to start again on).
I've tried ImageAssist with the FCK Editor and TinyMCE and WYSIWYG API, all with no success. Anyone know of a different uploading solution other than Image Assist, or any other solution to this problem, be great to hear it!!
Comment #24
quicksketchAminto, this issue is for Safari + ImageField/FileField. Image assist is a separate project and any problem with that module should be addressed in the Image assist queue.
Comment #25
skatepark123 CreditAttribution: skatepark123 commentedI am having the exact same problem in Safari AND Firefox. In Firefox, the throbber spins and stops once the file is uploaded, but it does not fade to the thumbnail with the "Remove" button. It just stays at the "Browse" field. Same in Safari, only the throbber keeps spinning indefinitely.
However, I also have a required text field for the content type, and after I upload the image and click save (without entering text into the required field) it reloads the form with the "field is required" error, but now the thumbnail with "Remove" button finally appears, instead of the "Browse" field. So the image seems to upload fine in the background, but the user interface is not functioning properly.
I am running both FileField and ImageField 3.1.
I REALLY hope there is some possible way to fix this, as it has rendered my site useless (and I've been working on it 16 hours a day for 3 weeks). If you don't have any idea what it could be, please let me know which file is responsible for the fade-in to thumbnail action. That way, I'll know which file to begin staring at for 16 hours a day, in the hopes of figuring out how to fix it.
Thanks for reading.
Comment #26
skatepark123 CreditAttribution: skatepark123 commentedI made a mistake, Safari does not make the throbber spin indefinitely. It acts exactly the same as Firefox. It spins during uploading, but does not show the thumbnail.
Comment #27
skatepark123 CreditAttribution: skatepark123 commentedI've pasted the loaded scripts from the source code of the upload form page.
I'm not really a developer, but I'm assuming that the problem has something to do with javascript and I thought this might be relevant information.
Comment #28
skatepark123 CreditAttribution: skatepark123 commentedSorry, one last thing. If there is no way to fix this, is there some way I can just disable the javascript or ajax functionality?
I'm just looking for some way to salvage all of the work I put into the site... even if it's at the cost of the awesome user interface.
Comment #29
skatepark123 CreditAttribution: skatepark123 commentedI'm an idiot. I guess the fact that it uploads the image when saving means that it's already operating without without ajax. Would be nice to get the thumbnail generation to work again though.
Comment #30
vincent-b CreditAttribution: vincent-b commentedHi, I have the same bug I think, altouhgh it happens with Safari 4 : Version 4.0 (5530.17) + OS X 10.5.7
Two images uplaoded through a form without problem, then it's one on ten image that succeeds, the others are failing after a while. It takes ffox seconds to upload one.
+ it concerns Drupal 6.13, 2009-07-01
Comment #31
John Pitcairn CreditAttribution: John Pitcairn commentedYep, same issue here it seems.
Local: Safari 4.0.2, Mac OS X 10.5.7
Server: Drupal 6.13, Imagefield 6.x-3.1
Comment #32
davidredshaw CreditAttribution: davidredshaw commentedI built a little module which may fix this. It's based on the comments here and elsewhere and appears to work for me using filefield 6.x-3.1... Nothing to do other than install the module and enable it.
It was created on a Mac so will have the ._ files I'm afraid but if it works and is useful I can clean it up.
Comment #33
pribeh CreditAttribution: pribeh commentedAny updates on this? Anybody else tried dredshaw's module? I guess I will later tonight. This is really annoying for so many of my users who use Safari.
Comment #34
pribeh CreditAttribution: pribeh commentedSo I tried Dreadshaw's module and now the browser crashes upon clicking the upload button. Using Safari 4.03 and Drupal 6.14 and Imagefield 3.1.
Comment #35
svogel CreditAttribution: svogel commentedInterested in this, too.
Comment #36
rickme CreditAttribution: rickme commentedHey guys, even though I'm not using Drupal, I came across a similar bug with my own upload script. After submitting the form, Safari wouldn't even send the file to the server (I checked with Activity Monitor.) After hours of Googling I found out that it's actually a bug in webKit. I fixed my script by adding an extra header to the page that contains the upload-form.
This is the fix I found:
http://arfore.com/2009/11/04/file-upload-hang-in-safari-4/
I just added the following header to my page (in PHP), which basically does the same thing as the javascript fix above
header("connection: close");
I came across this topic as I was trying to find a fix for my own script so I don't know if it'll work in Drupal :)
-Rick
Comment #37
pribeh CreditAttribution: pribeh commentedThanks a lot Rick. That's very kind of you. I'll try this and report back to this thread.
Comment #38
pribeh CreditAttribution: pribeh commentedI can confirm that sticking the following javascript code (taken from http://arfore.com/2009/11/04/file-upload-hang-in-safari-4/) into the head of your page.tpl will fix the issue.
Thanks Rick.
Comment #39
davidredshaw CreditAttribution: davidredshaw commentedThat's basically what the module does.
It provides a menu callback ("/ping/close") that sends the Connection: Close header and also uses hook_init to add a Javascript file that binds a request to the MouseDown event of input controls with a class of form-submit.
I suspect if it didn't work it's an issue with my Javascript file which is:
You could try replacing my javascript (in "safari_upload/js/safari_upload.js") with the code in comment 38 if it's better javascript since we've both used the same callback URL. I think it would be good to have a simple module-based fix for this until it can be fixed properly.
I got the info to make the module from a number of places:
* Adds custom javascript to fix file uploads with Safari
*
* Thanks to : http://blog.airbladesoftware.com/2007/8/17/note-to-self-prevent-uploads-...
*
* Additional Information:
* http://drupal.org/node/375914#comment-1485768
* http://drupal.org/node/431244
* http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab...
Comment #40
pribeh CreditAttribution: pribeh commentedThanks a lot dredshaw. This is all helpful. I agree that a module of this sort could even prove useful in the Drupal repository until the issue is fixed in webkit.
Comment #41
kmontySubscribe
Comment #42
kmontyI'd also like to report that the module in #32 does not work with Safari 4.0.4
Comment #43
davidredshaw CreditAttribution: davidredshaw commentedHi there
I'm running this on Safari 4.0.4 (Mac) with no issues. I did just download ImageField and test it in case the class on the submit button was different from FileField (which is what I use this for) and it seems to work OK.
Just wondering if this is a caching issue - might be worth trying to clear your cache because I don't think I put that in the module.
Comment #44
pribeh CreditAttribution: pribeh commentedHi dredshaw,
I've tested this issue to death so on multiple sites with cron working and cashes flushed several hundred times already. I do think I've stumbled upon a fix. I don't have feedback from users yet but I can't seem to replicate the problem anymore myself using Safari 4.04.
I simply replaced the jquery.form.js in Drupal's misc folder with the one from here http://malsup.com/jquery/form/#download as quicksketch suggested in #15. I wish I would of read that comment earlier - must be dyslexic. I'm not into modifying core but I'm at the last straw now. I will report back once I have users reporting that it either works or doesn't.
Comment #45
trailerparkopera CreditAttribution: trailerparkopera commentedI just discovered that replacing the jquery.form.js in Drupal's misc folder with the one found on http://malsup.com/jquery/form/#download causes the javascript_aggregation module to throw fatal errors. And, as we have a lot of javascripts that need aggregating, replacing the form.js doesn't work for us. Removing the javascript_aggregation module and leaving the form doesn't let Safari upload, (Firefox, on the other hand, works flawlessly).
Can't seem to get any love from the Safari_upload module either (nor adding the js directly to the template).
In fact, I can't get Safari to upload any images (except if I simply select the file, don't use the upload button, and save the node. But this isn't a solution for us as we need to upload multiple images during the same authoring/editing session).
Comment #46
pribeh CreditAttribution: pribeh commentedYes, I can confirm that the javascript_aggregation actually took a site of mine down once after adding the new form.js and spitting out a ton of errors - tres miserable. I wish there was a solution to this issue that worked well with but I can't seem to find the nail in the coffin for this issue.
Comment #47
myers_d CreditAttribution: myers_d commentedHaving the same issue in Safari 4.0.4 on Mac OS X. Works fine in FireFox.
Comment #48
quentinsf CreditAttribution: quentinsf commentedI can confirm that a combination of 38 and 39 has largely fixed this for me. (Safari 4.0.5).
I put the following in a javascript file that my theme was already loading. (And flushed the caches, of course!)
Comment #49
quentinsf CreditAttribution: quentinsf commentedMmm. No, I take that back. It helps, but it doesn't fix it.
Comment #50
geerlingguy CreditAttribution: geerlingguy commentedStill an issue with Safari 5 / Drupal 6.17 ... Chrome usually works, Safari is 50/50 (my sites are hosted in a variety of places/environments).
Comment #51
timtunbridge CreditAttribution: timtunbridge commentedSubscribe.
Comment #52
plan9 CreditAttribution: plan9 commentedSubscribe
Comment #53
plan9 CreditAttribution: plan9 commentedOne thing to bear in mind with Safari is that it has an over zealous browser caching mechanism. Even if you manage to disable the local cache it still caches in memory - so when testing this bug you are better of quitting and re-launching the app.
Anyway... I've found a solution that works - at least on my setup.
Using Rick's PHP alternative from #36 I put the following in my theme's page.tpl.php file - straight after the head tag:
So far so good.
I hope this helps someone else.
Comment #54
benklocek CreditAttribution: benklocek commentedI can't get either to work, and I wonder if it has to do with the page that the AJAX for is submitting to. If it's not using page.tpl.php, then I don't think the header trick will work, as it's not being called before the upload script is run.
As a side note: when I try to js script, I get a 404 error for "/ping/close". Is that the expected behavior?
UPDATE: Adding an empty file named "close" at "/ping" did the trick.
Comment #55
ilfelice CreditAttribution: ilfelice commentedI use Chrome and today I noticed that I had the same problem using Chrome on a site that I have been working for the last couple of weeks. Here is the solution that I found:
https://drupal.org/node/585216#comment-2079622
Basically, remove any extra blank lines your template.php may have at the end of the file, and that does the trick.
Not sure if this is the same cause when using Safari, but sharing anyway just in case it can be of help.
Comment #56
bdwelle CreditAttribution: bdwelle commentedI just noticed the same problem when I pushed a site that I recently finished live. The development server was hosted on Dreamhost, and ImageField uploads work fine in Safari on that site (e3.lifeisartfoundation.org) but when I run the exact same code/site/modules on the live site, which is hosted on HostMonster, Safari fails to upload and spits out a bunch of jQuery gibberish instead. I can upload successfully with Firefox on the live site.
Here is the junk that's displayed (instead of the image thumbnail) when I try to upload using Safari on the live site:
We are running Drupal 6.17, php 5.2.13 (5.2.14 on the dev site), ImageField 6.x-3.3, Safari 5.0.2, Mac OS 10.6.4
Comment #57
benklocek CreditAttribution: benklocek commentedI've just got this working with Safari 5, by using the code in #39, and changing my ping/close file to ping/close.php and sending a close header.
The issue I ran into with some of the other code (#38 for example) is that it's for the Prototype JS library.
The other issue is that drupal spits out some javascript that manipulates the mousedown event on "input.form-submit". I'm guessing this interferes with a simple mousedown() action. The code in #39 adds the action to the drupal event queue and allows it to be executed.
I have not tried the module yet.
Comment #58
Toddish CreditAttribution: Toddish commentedI get the same issue as #56 in Safari (5.0.1 (6533.17.8)) and also in Chrome (6.0.472.63) and Opera (10.62).
I've tried all the fixes on this page and none seem to work for me.
Comment #59
marinaqua CreditAttribution: marinaqua commentedI have the same problem with Safari (5.0.2) and Opera (10.63), and none of the solutions work for me. Chrome(7.0.517.41) is working properly.
Comment #60
plan9 CreditAttribution: plan9 commentedUpdating the title to reflect the fact that this is a wider browser issue.
Comment #61
marinaqua CreditAttribution: marinaqua commentedAs I wrote in my previous post (#59) I had the same problem. I'm not a programmer, so I started to disable the modules, compare the modified files with my theme's(Sky) initial ones, and by chance I've deleted the last "?>" php mark from my template.php and the "upload" problem has gone from both Opera and Safari browsers.
Actually I would really appreciate if anybody explain me this.
Thanks.
Comment #62
augiem CreditAttribution: augiem commented@benklocek #57
I'm still struggling with this issue on some sites and I've tried #38 to no avail. You mention using #39, but you haven't tried the module yet... #39 is the JS from the module, which doesn't look like it would work without the module installed. (Drupal.safari_upload = {...)
Would you mind posting the code of exactly what you did including the JS and the close.php file?
Thanks!
Comment #63
JonMcL CreditAttribution: JonMcL commentedsubscribing
Comment #64
pribeh CreditAttribution: pribeh commented@ augiem, have you tried removing empty spaces at the end of your theme's template.php file?
Comment #65
markabur CreditAttribution: markabur commentedStarted seeing this problem in Safari 5 on my MAMP setup, which had been working perfectly last week. I *think* the problem started when I turned on KeepAlive for Apache when I was performance-tuning. I can troubleshoot that I guess. I tried the module in #34 and it seems to be working though.
Comment #66
Rob T CreditAttribution: Rob T commentedI just ran into the same issue. So far, #53 has helped
Comment #67
mk31762 CreditAttribution: mk31762 commentedVery frustrating. I have tried all the fixes described here and still get the error. Not intermittently, either. I get it every time. I have to tell my users they can't use Safari. Mac users never take kindly to that.
Comment #68
betamos CreditAttribution: betamos commentedCan someone please clarify where this bug is located? Is it WebKit, jquery.forms.js or a Drupal bug? This has been a major issue for my client until i found this thread and changed browser.
And btw, subscribing!
Comment #69
eme CreditAttribution: eme commentedBy installing latest cck release and latest Safari browser, you should get the bug easily.
None of the above hack worked for me...sadly.
Works on Chrome for me.
Comment #70
MrSchoolcraft CreditAttribution: MrSchoolcraft commentedI get this issue in Internet Explorer 9 with the latest stable builds of cck, filefield and imagefield. The ajax throbber just spins and spins with no image upload. But 'save and continue' or 'save' uploads it just fine.
Going to look into my page.tpl.php file to see if that is an issue.
Any other headway on this?
Comment #71
Anonymous (not verified) CreditAttribution: Anonymous commentedSame issue here in D6 and apparently also with D7 filefields and the mentioned browsers. Doesn't upload, eternal throbbing. Saving the node also uploads the picture correctly. Seems to be a broad issue and also affect D7 core fields. I have uploadprogress.so installed.
Edit: Disabling HTTP KEEPALIVE in my apache configuration fixed the problem for Safari (so far). Since I don't have much load, disabling keepalive does not make any difference in overall performance. Might make a difference on high load websites.
Comment #72
jide CreditAttribution: jide commented@genox trick did work for me.
Just add "KeepAlive Off" to your vhost :
Comment #73
kris digital CreditAttribution: kris digital commentedI had the problem in D7 and wrapped it up in a small module. For me it solved the issue.
http://drupal.org/sandbox/krisdigital/1423322
Comment #74
CarbonPig CreditAttribution: CarbonPig commented@jide #72
Where does this code apply? What file.
Sorry if this is a dumb ?, but I'm lost and trying to resolve this issue.
Thanks
Comment #75
jide CreditAttribution: jide commented@CarbonPig: In your httpd.conf file. It is the Apache settings file.
Comment #76
jsgammato CreditAttribution: jsgammato commentedI stumbled onto a dumb little workaround on D6 using Safari : browse to the image and click Save. Do NOT click Attach. Just browse and save.
This has worked for me on there sites.
Comment #77
direcs CreditAttribution: direcs commented@krisdigital
THANKS!! You made my day! I was near a nervous breakdown since I had to upload *all* my podcast episodes on robotiklabor.de and wasn't able before. And I do not have access to any server configurations...
Again: Many thanks! Worked fine with D7.15.
PS.: Looked for me that I needed to install http://drupal.org/project/jquery_ui to bring your module to life, as well.
Comment #78
quicksketchThe solutions proposed here seem to be accommodating for Safari browser bugs. As of late it seems like this problem has been happening with lesser frequency as people update their browsers to newer versions.
Here's the report for Webkit, but we can't actually see if Apple has solved the problem because it's been moved into their internal "Radar" tracker (apparently with the tracking number #7547183). My guess is that it's been fixed in newer versions of Safari.
I'm moving this to a support request, as I don't think ImageField is responsible for solving this issue.
Comment #79
direcs CreditAttribution: direcs commentedTo be honest, I do not care anymore. Migrated to Wordpress now with all blogs. And I am very happy and have the feeling of arriving in the 21st century now...
Comment #80
quicksketchWordPress is a great blogging tool. Drupal 6 was originally released in 2008 and unlike WordPress, only receives new features in "major" releases, so using it definitely can feel like running crufty 5 year-old software. Maybe with the D8 release we can lure you back to Drupal for blogging. :)
Comment #81
david_drupal CreditAttribution: david_drupal commentedIn my opinion (although I LOVE wordpress), It doesn't have the capabilities of drupal.
So yes, if you want something simple go for word-press. Otherwise go for drupal.